How platzi/curso-python-pip works
Project type and purpose
• This repository is a “monorepo” containing four independent Python-based subprojects:
• Game Project (under /game) – a standalone CLI game.
• App Project (under /app) – a data-driven application that reads CSV data, applies utilities, and generates charts.
• Charts Utility (under /charts) – a chart‐generation script or library.
• Web-Server (under /web-server) – a simple HTTP service with a storage component.
File structure
• Top-level: README.md, hello.py (a throwaway script?), .gitignore.
• /game: main.py – single Python entry point.
• /app: Dockerfile + docker-compose.yml, requirements.txt, main.py + helper modules (read_csv.py, utils.py, charts.py), imgs/, data.csv.
• /charts: charts.py, main.py – likely an independent CLI or library.
• /web-server: Dockerfile + docker-compose.yml, requirements.txt, main.py (HTTP server), store.py (data persistence).
Key insights from the README
• Two explicit “quick-start” sections: one for the Game, one for the App.
• Both run as standalone Python scripts; the App uses a virtualenv or Docker.
• No mention of inter-service communication or orchestration between subprojects.
a. Main components
1. Version Control (Git Repo)
2. Game Service
3. App Service
– Data Ingestion (read_csv.py)
– Business Logic (utils.py)
– Charting Module (charts.py)
– Assets (data.csv, imgs/)
4. Charts Utility (standalone)
5. Web-Server Service
– HTTP API (main.py)
– Storage Layer (store.py)
b. Relationships and interactions
• Game Service: self-contained; no external dependencies.
• App Service:
• Reads data.csv → processes via read_csv.py + utils.py → generates charts via its own charts.py → writes to imgs/.
• Optionally, you might treat /charts as an external library or microservice if the App imports it.
• Charts Utility: independent CLI; can be consumed by other projects (if imported).
• Web-Server Service: self-contained REST API → persists data via store.py.
c. Architectural patterns & principles
• Separation of Concerns: each subproject has its own directory, dependencies, and Docker setup.
• Containerization: App and Web-Server each have Dockerfiles + docker-compose for reproducible deployments.
• Modularization: the charting logic is packaged twice (once in /app/charts.py, once in /charts), suggesting the possibility to refactor into a shared library.
d. Key technologies
• Python 3.x
• Docker & Docker Compose
• Virtualenv (for /app if not containerized)
• CSV data processing (Pandas or built-ins)
• HTTP server framework (Flask, FastAPI, or BaseHTTPServer)
• Four subprojects and their boundaries.
• Decompose each into modules or layers where applicable.
• Container vs. non-container deployment.
• Data flows and tech stacks.