# vianeey160/a003-poetry-setup architecture

> Architecture diagram of the GitHub repository vianeey160/a003-poetry-setup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vianeey160/a003-poetry-setup
- Repository: https://github.com/vianeey160/a003-poetry-setup

## Overview

##### Project Type and Purpose
- This repo is an educational Python project focused on teaching students how to set up and use Poetry (and compare it to pyenv). It uses Jupyter notebooks for interactive lessons and includes a small example package (`a003_poetry_setup`) plus tests.

##### File Structure Analysis
- Top level:
- `.gitignore`, `.env.example`, `pyproject.toml` (Poetry config and dependency declarations)
- Jupyter notebooks (`zzz-nb001-*.ipynb`, `zzz-nb002-*.ipynb`) for lessons
- `a003_poetry_setup/` – the example Python package (with `__init__.py`)
- `tests/` – pytest suite, likely executed via Poetry
- No README content, so architecture must be inferred: notebooks import and demonstrate the package, tests verify it, Poetry manages everything.

##### Key Components
- Developer Workstation (IDE/Terminal)
- Version Control (Git)
- Poetry Environment Manager
- Python Interpreter
- Example Package (`a003_poetry_setup`)
- Jupyter Notebook Server (renders `zzz-nb*.ipynb`)
- Test Runner (pytest)
- Configuration Files (`pyproject.toml`, `.env`)

##### Component Relationships and Data Flows
a. The Developer clones the repo (Git) and runs `poetry install` → Poetry reads `pyproject.toml` → sets up a virtual environment.
b. Developer launches Jupyter server via `poetry run jupyter lab` → loads notebooks.
c. Notebook code cells import `a003_poetry_setup` → Python interpreter resolves imports from the Poetry venv.
d. Environment variables from `.env` (loaded by notebooks or package if applicable) configure behavior.
e. Developer runs tests with `poetry run pytest` → pytest discovers tests in `tests/` → exercises code in `a003_poetry_setup`.

##### Architectural Patterns and Principles
- Modular code: separate example package and test suite.
- Dependency isolation: Poetry-managed virtual environment.
- Interactive teaching layer: Jupyter notebooks separate from core package.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Development Tools"
        Developer["Developer Workstation"]
        Git["Version Control (Git)"]:::tool
        Poetry["Poetry Environment Manager"]:::tool
        Config["Configuration Files (pyproject.toml, .env.example)"]:::artifact
    end

    subgraph "Interactive Layer"
        Jupyter["Jupyter Notebook Server"]:::runtime
        NB1["zzz-nb001-poetry-vs-pyenv.ipynb"]:::artifact
        NB2["zzz-nb002-student-setup-after-downloading-code.ipynb"]:::artifact
    end

    subgraph "Runtime/Test Layer"
        Python["Python Interpreter"]:::runtime
        Package["Example Package (a003_poetry_setup)"]:::artifact
        Pytest["Test Runner (pytest)"]:::runtime
        Tests["Test Suite (tests/)"]:::artifact
    end

    Developer -->|"clone repo"| Git
    Git -->|"poetry install"| Poetry
    Config -->|"reads config"| Poetry
    Poetry -->|"creates venv"| Python
    Developer -->|"poetry run jupyter lab"| Jupyter
    Jupyter -->|"loads"| NB1
    Jupyter -->|"loads"| NB2
    NB1 -->|"import"| Python
    NB2 -->|"import"| Python
    Python -->|"resolves imports from"| Package
    Developer -->|"poetry run pytest"| Pytest
    Pytest -->|"discovers tests in"| Tests
    Tests -->|"executes via"| Python
    Tests -->|"tests code in"| Package

    click Git "https://github.com/vianeey160/a003-poetry-setup/blob/master/.gitignore"
    click Config "https://github.com/vianeey160/a003-poetry-setup/blob/master/pyproject.toml"
    click Config "https://github.com/vianeey160/a003-poetry-setup/blob/master/.env.example"
    click Package "https://github.com/vianeey160/a003-poetry-setup/blob/master/a003_poetry_setup/__init__.py"
    click NB1 "https://github.com/vianeey160/a003-poetry-setup/blob/master/zzz-nb001-poetry-vs-pyenv.ipynb"
    click NB2 "https://github.com/vianeey160/a003-poetry-setup/blob/master/zzz-nb002-student-setup-after-downloading-code.ipynb"
    click Tests "https://github.com/vianeey160/a003-poetry-setup/tree/master/tests/"
    click Tests "https://github.com/vianeey160/a003-poetry-setup/blob/master/tests/__init__.py"

    classDef tool fill:#cfe2f3,stroke:#000,stroke-width:1px;
    classDef runtime fill:#d4e157,stroke:#000,stroke-width:1px;
    classDef artifact fill:#ffe082,stroke:#000,stroke-width:1px;
```
