# gtm-safal/cs50p architecture

> Architecture diagram of the GitHub repository gtm-safal/cs50p, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gtm-safal/cs50p
- Repository: https://github.com/gtm-safal/cs50p

## Overview

##### Project Type and Purpose
- This is an educational repository of standalone Python scripts and exercises for CS50P’s Introduction to Programming with Python.
- Each “Week N” folder contains one or more problem‐set scripts (e.g., loops, file I/O, OOP) plus, in some weeks, resource files (CSV, TXT) and unit tests.

##### File Structure
- Top‐Level “Week 0” through “Week 9” directories, each holding one or more `.py` files named after the exercise, with occasional subfolders for tests or data.
- In Week 5, Week 7, and Week 8, test subdirectories (`test_bank`, `test_numb3rs`, etc.) coexist alongside their implementations.
- Week 6 contains data assets (`.csv`, `.txt`) together with scripts that parse them.

##### README for Insights
- Confirms Python 3.8+, use of `pytest` for tests, and topical grouping (functions, loops, exceptions, libraries, file I/O, regex, OOP, CLI).
- Emphasizes that these are standalone command‐line tools rather than a single integrated service.

##### Elements
- Labels: directory names (Week 0 … Week 9), script names (e.g., `fuel.py`), test names (`test_fuel.py`).
- CLI → Script (execution)
- Script → Resource File (I/O)
- Test → Script (dependency)
- Blue rectangles for scripts
- A gray oval for the Python interpreter
- A stick‐figure for the CLI user

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors and runtime
    CLI((CLI)):::actor
    Interpreter((Python 3.8+)):::interpreter
    CLI -->|execute| Interpreter

    %% Week 0
    subgraph "Week 0"
      direction TB
      e1["einstein.py"]:::script
      e2["faces.py"]:::script
      e3["functions_and_variables.py"]:::script
      e4["indoor.py"]:::script
      e5["playback.py"]:::script
      e6["tip.py"]:::script
    end
    Interpreter -->|executes| e1
    Interpreter -->|executes| e2
    Interpreter -->|executes| e3
    Interpreter -->|executes| e4
    Interpreter -->|executes| e5
    Interpreter -->|executes| e6

    %% Week 5
    subgraph "Week 5"
      direction TB
      sq["square.py"]:::script
      subgraph "test_bank"
        tb_imp["bank.py"]:::script
        tb_test["test_bank.py"]:::test
      end
      subgraph "test_fuel"
        tf_imp["fuel.py"]:::script
        tf_test["test_fuel.py"]:::test
      end
      subgraph "test_plates"
        tp_imp["plates.py"]:::script
        tp_test["test_plates.py"]:::test
      end
      subgraph "test_twttr"
        tt_imp["twttr.py"]:::script
        tt_test["test_twttr.py"]:::test
      end
      ut["unit_tests.py"]:::test
    end
    Interpreter -->|executes| sq
    Interpreter -->|executes| tb_imp
    tb_test -->|tests| tb_imp
    Interpreter -->|executes| tf_imp
    tf_test -->|tests| tf_imp
    Interpreter -->|executes| tp_imp
    tp_test -->|tests| tp_imp
    Interpreter -->|executes| tt_imp
    tt_test -->|tests| tt_imp
    ut -->|runs| tb_test
    ut -->|runs| tf_test
    ut -->|runs| tp_test
    ut -->|runs| tt_test

    %% Week 6
    subgraph "Week 6"
      direction TB
      c1["csv.py"]:::script
      f1["file_IO.py"]:::script
      l1["lines.py"]:::script
      subgraph "pizza"
        p_imp["pizza.py"]:::script
        p1[(regular.csv)]:::data
        p2[(sicilian.csv)]:::data
      end
      subgraph "scourgify"
        s_imp["scourgify.py"]:::script
        s1[(before.csv)]:::data
        s2[(after.csv)]:::data
      end
      sh["shirt.py"]:::script
      st1[(students.csv)]:::data
    end
    Interpreter -->|executes| c1
    Interpreter -->|executes| f1
    Interpreter -->|executes| l1
    Interpreter -->|executes| p_imp
    p_imp -->|reads| p1
    p_imp -->|reads| p2
    Interpreter -->|executes| s_imp
    s_imp -->|reads| s1
    s_imp -->|reads| s2
    Interpreter -->|executes| sh
    sh -->|reads| st1

    %% Week 7
    subgraph "Week 7"
      direction TB
      n_imp["numb3rs.py"]:::script
      n_test["test_numb3rs.py"]:::test
      um_imp["um.py"]:::script
      um_test["test_um.py"]:::test
      w_imp["working.py"]:::script
      w_test["test_working.py"]:::test
      r_imp["response.py"]:::script
      re_imp["regular_expressions.py"]:::script
      wa_imp["watch.py"]:::script
    end
    Interpreter -->|executes| n_imp
    n_test -->|tests| n_imp
    Interpreter -->|executes| um_imp
    um_test -->|tests| um_imp
    Interpreter -->|executes| w_imp
    w_test -->|tests| w_imp
    Interpreter -->|executes| r_imp
    Interpreter -->|executes| re_imp
    Interpreter -->|executes| wa_imp

    %% Week 8
    subgraph "Week 8"
      direction TB
      jar_imp["jar.py"]:::script
      jar_test["test_jar.py"]:::test
      se_imp["seasons.py"]:::script
      se_test["test_seasons.py"]:::test
      oop["oop.py"]:::script
      sc_imp["shirtificate.py"]:::script
      sc_pdf[(shirtificate.pdf)]:::data
    end
    Interpreter -->|executes| jar_imp
    jar_test -->|tests| jar_imp
    Interpreter -->|executes| se_imp
    se_test -->|tests| se_imp
    Interpreter -->|executes| oop
    Interpreter -->|executes| sc_imp
    sc_imp -->|reads| sc_pdf

    %% Week 9
    subgraph "Week 9"
      direction TB
      misc["Et_cetera.py"]:::script
    end
    Interpreter -->|executes| misc

    %% Click Events
    click e1 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/einstein/einstein.py"
    click e2 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/faces/faces.py"
    click e3 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/functions_and_ variables.py"
    click e4 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/indoor/indoor.py"
    click e5 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/playback/playback.py"
    click e6 "https://github.com/gtm-safal/cs50p/blob/main/Week 0/tip/tip.py"
    click sq "https://github.com/gtm-safal/cs50p/blob/main/Week 5/square.py"
    click tb_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_bank/bank.py"
    click tb_test "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_bank/test_bank.py"
    click tf_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_fuel/fuel.py"
    click tf_test "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_fuel/test_fuel.py"
    click tp_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_plates/plates.py"
    click tp_test "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_plates/test_plates.py"
    click tt_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_twttr/twttr.py"
    click tt_test "https://github.com/gtm-safal/cs50p/blob/main/Week 5/test_twttr/test_twttr.py"
    click ut "https://github.com/gtm-safal/cs50p/blob/main/Week 5/unit_tests.py"
    click c1 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/csv.py"
    click f1 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/file_IO.py"
    click l1 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/lines/lines.py"
    click p_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 6/pizza/pizza.py"
    click p1 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/pizza/regular.csv"
    click p2 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/pizza/sicilian.csv"
    click s_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 6/scourgify/scourgify.py"
    click s1 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/scourgify/before.csv"
    click s2 "https://github.com/gtm-safal/cs50p/blob/main/Week 6/scourgify/after.csv"
    click sh "https://github.com/gtm-safal/cs50p/blob/main/Week 6/shirt/shirt.py"
    click n_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 7/numb3rs/numb3rs.py"
    click n_test "https://github.com/gtm-safal/cs50p/blob/main/Week 7/numb3rs/test_numb3rs.py"
    click um_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 7/um/um.py"
    click um_test "https://github.com/gtm-safal/cs50p/blob/main/Week 7/um/test_um.py"
    click w_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 7/working/working.py"
    click w_test "https://github.com/gtm-safal/cs50p/blob/main/Week 7/working/test_working.py"
    click jar_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 8/jar/jar.py"
    click jar_test "https://github.com/gtm-safal/cs50p/blob/main/Week 8/jar/test_jar.py"
    click se_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 8/seasons/seasons.py"
    click se_test "https://github.com/gtm-safal/cs50p/blob/main/Week 8/seasons/test_seasons.py"
    click sc_imp "https://github.com/gtm-safal/cs50p/blob/main/Week 8/shirtificate/shirtificate.py"
    click sc_pdf "https://github.com/gtm-safal/cs50p/blob/main/Week 8/shirtificate/shirtificate.pdf"
    click misc "https://github.com/gtm-safal/cs50p/blob/main/Week 9/Et_cetera.py"

    %% Styles
    classDef script fill:#cfe2f3,stroke:#000
    classDef data fill:#d9ead3,stroke:#000
    classDef test stroke-dasharray:5 5,fill:#fce5cd,stroke:#e69138
    classDef actor stroke:#000,fill:#fff
    classDef interpreter fill:#cccccc,stroke:#333
```
