# vincent-stragier/nombres_vers_lettres architecture

> Architecture diagram of the GitHub repository vincent-stragier/nombres_vers_lettres, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vincent-stragier/nombres_vers_lettres
- Repository: https://github.com/vincent-stragier/nombres_vers_lettres

## Overview

##### Project type and purpose
- This is an open-source Python library and CLI tool (“nombres_vers_lettres”) whose sole purpose is to convert numeric strings into their French‐language textual representations (cardinal, ordinal, currency).
- The README makes it clear that it installs as a package, exposes a public API (`make_letters`) and two console entry points (`nombres_vers_lettres` and `nvl`).

##### File structure
- Top level:
- Configuration & metadata: `.flake8`, `setup.py`/`pyproject.toml`/`setup.cfg`, `requirements*.txt`, CI workflows under `.github/workflows`.
- Source code under `src/nombres_vers_lettres/`
- Unit tests under `tests/`
- `src/nombres_vers_lettres/` contains:
- `__main__.py` – CLI entry point
- `make_letters.py` – main conversion logic (parsing, partitioning, assembling text)
- `constants.py` – language codes, currency codes, rules data
- `tests/fr_test.py` – verifies correctness against known French representations.

##### README for additional insights
- Describes:
- Public API (the `make_letters` function with parameters such as `mode`, `language`, `gender`, `plural`, `post_1990_orthographe`)
- CLI usage (arguments, flags mapped one‐to‐one to API parameters)
- Development workflow: pre-commit, pytest, coverage, and CI publishing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Runtime Components"
        CLI["CLI Entry Point\n__main__.py"]:::runtime
        API["Public API\nmake_letters()"]:::runtime
    end

    subgraph "Core Library"
        Conversion["Conversion Engine\nmake_letters.py"]:::core
        Constants["Constants/Data\nconstants.py"]:::core
    end

    subgraph "Dev Workflow"
        Tests["Unit Tests\nfr_test.py"]:::dev
        PreCommitCfg[".pre-commit-config.yaml"]:::dev
        IsortCfg[".isort.cfg"]:::dev
        FlakeCfg[".flake8"]:::dev
        subgraph "CI/CD Pipelines"
            Linter["Linter Workflow\nlinter.yml"]:::dev
            PublishCI["Publish Workflow\npublish-to-pypi.yml"]:::dev
        end
    end

    subgraph "Distribution"
        SetupPy["setup.py"]:::dist
        PyProject["pyproject.toml"]:::dist
        SetupCfg["setup.cfg"]:::dist
        PyPI["PyPI Repository"]:::dist
    end

    CLI -->|"invoke"| Conversion
    API -->|"invoke"| Conversion
    Conversion -->|"reads rules"| Constants
    Constants -->|"provides data"| Conversion
    Tests -->|"validate"| Conversion
    Tests -->|"validate"| Constants
    PreCommitCfg -->|"analyse"| Conversion
    PreCommitCfg -->|"analyse"| Constants
    IsortCfg -->|"analyse"| Conversion
    IsortCfg -->|"analyse"| Constants
    FlakeCfg -->|"analyse"| Conversion
    FlakeCfg -->|"analyse"| Constants
    Linter -->|"runs tests & style checks"| Tests
    Linter -->|"runs hooks"| PreCommitCfg
    Linter -->|"runs hooks"| IsortCfg
    Linter -->|"runs hooks"| FlakeCfg
    PublishCI -->|"on release tag"| SetupPy
    PublishCI -->|"on release tag"| PyProject
    PublishCI -->|"on release tag"| SetupCfg
    SetupPy -->|"publish"| PyPI
    PyProject -->|"publish"| PyPI
    SetupCfg -->|"publish"| PyPI

    click CLI "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/src/nombres_vers_lettres/__main__.py"
    click API "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/src/nombres_vers_lettres/make_letters.py"
    click Conversion "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/src/nombres_vers_lettres/make_letters.py"
    click Constants "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/src/nombres_vers_lettres/constants.py"
    click Tests "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/tests/fr_test.py"
    click Linter "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/.github/workflows/linter.yml"
    click PublishCI "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/.github/workflows/publish-to-pypi.yml"
    click PreCommitCfg "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/.pre-commit-config.yaml"
    click IsortCfg "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/.isort.cfg"
    click FlakeCfg "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/.flake8"
    click SetupPy "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/setup.py"
    click PyProject "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/pyproject.toml"
    click SetupCfg "https://github.com/vincent-stragier/nombres_vers_lettres/blob/main/setup.cfg"

    classDef runtime fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
    classDef core fill:#FCF3CF,stroke:#7D6608,color:#1B2631
    classDef dev fill:#FADBD8,stroke:#922B21,color:#1B2631
    classDef dist fill:#D5F5E3,stroke:#186A3B,color:#1B2631
```
