# codebasics/py architecture

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

- Interactive diagram: https://gitdiagram.com/codebasics/py
- Repository: https://github.com/codebasics/py

## Overview

This repository is a collection of beginner Python lessons and practical examples, not one integrated application. Its principal user-to-result workflows are standalone scripts that accept inputs or data and print or return results, plus two web demos: home-price estimation and celebrity-image classification. The map highlights those end-to-end demos and representative learning areas, while preserving separate examples for web APIs, scraping, machine learning, data analysis, and concurrency. The README describes broad learning coverage; unsampled subsystems are represented only where the tree supports a path, and their internal wiring is omitted.

Main entry points: [`DataScience/BangloreHomePrices/server/server.py`](https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/server/server.py) (Home price API), [`DataScience/CelebrityFaceRecognition/server/server.py`](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/server/server.py) (Image classification API), [`DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py`](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py) (Image scraping), [`DataScience/BangloreHomePrices/client/app.js`](https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/client/app.js) (Home estimator UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web_demos["Web demos"]
  node_home_ui["Home estimator UI<br/>[app.js]"]
  node_home_api["Home price API<br/>[server.py]"]
  node_home_logic["Price utilities<br/>[util.py]"]
  node_face_ui["Face classifier UI<br/>[app.js]"]
  node_face_api["Image classification API<br/>[server.py]"]
  node_face_logic["Classification utilities<br/>[util.py]"]
end

subgraph group_learning["Python learning"]
  node_python_basics["Python fundamentals"]
  node_python_oop["Classes and iteration<br/>[17_class.py]"]
  node_fastapi_demo["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_data_ml["Data and ML"]
  node_ml_algorithms["ML algorithms<br/>[linearReg.py]"]
  node_gradient_descent["Gradient descent"]
  node_weather_analysis["Weather CSV analysis<br/>[pandas_intro.py]"]
  node_stock_analysis["Stock price analysis"]
end

subgraph group_tools["Other examples"]
  node_image_scraper["Image scraping<br/>[image_download.py]"]
  node_argparse_example["CLI arguments demo"]
  node_concurrency_examples["Process and thread examples"]
end

node_visitor(("Web user"))
node_google_images(("Image search service"))
node_weather_csv["Weather CSV input"]

node_visitor -->|"enters inputs"| node_home_ui
node_home_ui -->|"requests estimates"| node_home_api
node_home_api -->|"calls utilities"| node_home_logic
node_home_logic -->|"returns estimate"| node_home_api
node_visitor -->|"uploads image"| node_face_ui
node_face_ui -->|"posts image data"| node_face_api
node_face_api -->|"calls classifier"| node_face_logic
node_face_logic -->|"returns classifications"| node_face_api
node_visitor -->|"requests endpoints"| node_fastapi_demo
node_fastapi_demo -->|"returns responses"| node_visitor
node_weather_csv -->|"reads CSV"| node_weather_analysis
node_visitor -->|"runs analysis"| node_weather_analysis
node_visitor -->|"runs tutorial"| node_stock_analysis
node_image_scraper -->|"searches images"| node_google_images
node_image_scraper -->|"downloads images"| node_google_images
node_visitor -->|"runs examples"| node_python_basics
node_visitor -->|"runs examples"| node_python_oop
node_visitor -->|"runs example"| node_ml_algorithms
node_visitor -->|"runs example"| node_gradient_descent
node_visitor -->|"supplies arguments"| node_argparse_example
node_visitor -->|"runs examples"| node_concurrency_examples

click node_home_ui "https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/client/app.js"
click node_home_api "https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/server/server.py"
click node_home_logic "https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/server/util.py"
click node_face_ui "https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/UI/app.js"
click node_face_api "https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/server/server.py"
click node_face_logic "https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/server/util.py"
click node_python_basics "https://github.com/codebasics/py/tree/master/Basics"
click node_python_oop "https://github.com/codebasics/py/blob/master/Basics/17_class.py"
click node_fastapi_demo "https://github.com/codebasics/py/blob/master/Advanced/FastAPI/main.py"
click node_ml_algorithms "https://github.com/codebasics/py/blob/master/ML/1_linear_reg/linearReg.py"
click node_gradient_descent "https://github.com/codebasics/py/blob/master/ML/3_gradient_descent/gradient_descent.py"
click node_weather_analysis "https://github.com/codebasics/py/blob/master/pandas/1_intro/pandas_intro.py"
click node_stock_analysis "https://github.com/codebasics/py/blob/master/jupyter/pandas_tutorial_on_stock_price.py"
click node_image_scraper "https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py"
click node_argparse_example "https://github.com/codebasics/py/blob/master/Modules/argparse_tutorial.py"
click node_concurrency_examples "https://github.com/codebasics/py/tree/master/Multiprocessing"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home_ui,node_home_api,node_home_logic,node_face_ui,node_face_api,node_face_logic,node_visitor toneBlue
class node_python_basics,node_python_oop,node_fastapi_demo toneAmber
class node_ml_algorithms,node_gradient_descent,node_weather_analysis,node_stock_analysis toneMint
class node_image_scraper,node_argparse_example,node_concurrency_examples toneRose
class node_google_images,node_weather_csv toneIndigo
```

## Components

### Web demos

- [Home estimator UI](https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/client/app.js): `DataScience/BangloreHomePrices/client/app.js`
- [Home price API](https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/server/server.py): `DataScience/BangloreHomePrices/server/server.py`
- [Price utilities](https://github.com/codebasics/py/blob/master/DataScience/BangloreHomePrices/server/util.py): `DataScience/BangloreHomePrices/server/util.py`
- [Face classifier UI](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/UI/app.js): `DataScience/CelebrityFaceRecognition/UI/app.js`
- [Image classification API](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/server/server.py): `DataScience/CelebrityFaceRecognition/server/server.py`
- [Classification utilities](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/server/util.py): `DataScience/CelebrityFaceRecognition/server/util.py`

### Python learning

- [Python fundamentals](https://github.com/codebasics/py/tree/master/Basics): `Basics`
- [Classes and iteration](https://github.com/codebasics/py/blob/master/Basics/17_class.py): `Basics/17_class.py`
- [FastAPI endpoints](https://github.com/codebasics/py/blob/master/Advanced/FastAPI/main.py): `Advanced/FastAPI/main.py`

### Data and ML

- [ML algorithms](https://github.com/codebasics/py/blob/master/ML/1_linear_reg/linearReg.py): `ML/1_linear_reg/linearReg.py`
- [Gradient descent](https://github.com/codebasics/py/blob/master/ML/3_gradient_descent/gradient_descent.py): `ML/3_gradient_descent/gradient_descent.py`
- [Weather CSV analysis](https://github.com/codebasics/py/blob/master/pandas/1_intro/pandas_intro.py): `pandas/1_intro/pandas_intro.py`
- [Stock price analysis](https://github.com/codebasics/py/blob/master/jupyter/pandas_tutorial_on_stock_price.py): `jupyter/pandas_tutorial_on_stock_price.py`

### Other examples

- [Image scraping](https://github.com/codebasics/py/blob/master/DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py): `DataScience/CelebrityFaceRecognition/google_image_scrapping/image_download.py`
- [CLI arguments demo](https://github.com/codebasics/py/blob/master/Modules/argparse_tutorial.py): `Modules/argparse_tutorial.py`
- [Process and thread examples](https://github.com/codebasics/py/tree/master/Multiprocessing): `Multiprocessing`

### Other components

- **Web user**
- **Image search service**
- **Weather CSV input**

## Connections

- Web user → Home estimator UI: enters inputs
- Home estimator UI → Home price API: requests estimates
- Home price API → Price utilities: calls utilities
- Price utilities → Home price API: returns estimate
- Web user → Face classifier UI: uploads image
- Face classifier UI → Image classification API: posts image data
- Image classification API → Classification utilities: calls classifier
- Classification utilities → Image classification API: returns classifications
- Web user → FastAPI endpoints: requests endpoints
- FastAPI endpoints → Web user: returns responses
- Weather CSV input → Weather CSV analysis: reads CSV
- Web user → Weather CSV analysis: runs analysis
- Web user → Stock price analysis: runs tutorial
- Image scraping → Image search service: searches images
- Image scraping → Image search service: downloads images
- Web user → Python fundamentals: runs examples
- Web user → Classes and iteration: runs examples
- Web user → ML algorithms: runs example
- Web user → Gradient descent: runs example
- Web user → CLI arguments demo: supplies arguments
- Web user → Process and thread examples: runs examples
