# noworneverev/eurlex-parser architecture

> Architecture diagram of the GitHub repository noworneverev/eurlex-parser, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noworneverev/eurlex-parser
- Repository: https://github.com/noworneverev/eurlex-parser

## Overview

##### Main Components
- Core Package (src): Highlight the main modules “eurlex.py” and “utils.py.” The “eurlex.py” module is likely responsible for orchestrating data fetching and parsing, while “utils.py” supports common utility functions.
- Function API: Represent the exposed functions (e.g., get_data_by_celex_id, get_json_by_celex_id, get_articles_by_celex_id, get_summary_by_celex_id) as a distinct component that external users invoke.
- External Service: Show the EurLex website as an external component. Indicate that HTTP requests (or similar protocols) are made to this external service for legal document data.
- Data Export/Transformation: Represent the conversion capabilities into JSON and Pandas DataFrame formats (highlighting the use of libraries like Pandas and JSON).
- Examples: Represent the “examples” directory as sample usage/scenarios which validate that the package produces the expected data output.

##### Detail the Relationships and Interactions
- Data flow where the fetched content is parsed and structured, then passed into export transformers (for JSON and DataFrame generation).
- Internal dependencies among modules (for instance, “eurlex.py” utilizing helper functions in “utils.py”).

##### Architectural Patterns and Design Principles
- Separation between the API layer (user-facing functions) and the underlying implementation (parsing logic and utility functions). This demonstrates a clear abstraction barrier.
- Point out the use of a modular design—each file having a distinct role (data fetching, processing, and exporting).
- Reliance on external libraries (e.g., Pandas for DataFrame support) and standard modules (for JSON manipulation and possibly HTTP requests).

##### Instructing the Principal Software Engineer
- Clear labels for each component:
- Nodes for “JSON Export” and “Pandas DataFrame Export.”
- From API Interface → Parser → External Service, then back to Parser → Export Components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["API Interface (exposed functions)"]:::component
    B["Parser & Fetcher Component"]:::component
    C["Utilities Component"]:::component
    D(["EurLex Website"]):::external
    E["JSON Export"]:::export
    F["Pandas DataFrame Export"]:::export
    G["Examples/Demo Usage"]:::demo

    A -->|"calls"| B
    B -->|"uses"| C
    B -->|"fetches"| D
    B -->|"formats_to"| E
    B -->|"formats_to"| F
    G -->|"demonstrates_usage_of"| A

    click A "https://github.com/noworneverev/eurlex-parser/blob/main/src/eurlex.py"
    click B "https://github.com/noworneverev/eurlex-parser/blob/main/src/eurlex.py"
    click C "https://github.com/noworneverev/eurlex-parser/blob/main/src/utils.py"
    click G "https://github.com/noworneverev/eurlex-parser/tree/main/examples"

    classDef component fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5;
    classDef export fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef demo fill:#FFFF99,stroke:#333,stroke-width:2px;
```
