A compact project exploring Python OOP fundamentals, HTTP requests with requests, and a mini CLI client for API interactions.
- Python 3.10+
- Internet access (for API calls via JSONPlaceholder)
- pip (package manager)
# Linux/macOS
python3 -m venv .venv
source .venv/bin/activate
# Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txtIf your system Python is 3.10+, you can use
pythoninstead ofpython3.
Each task lives in src/ as a separate script:
# OOP tasks
python src/q01_oop_book_basics.py
python src/q02_oop_encapsulation.py
python src/q03_oop_inheritance.py
python src/q04_oop_polymorphism.py
python src/q05_oop_all_in_one.py
# HTTP requests tasks
python src/q06_requests_get.py
python src/q07_requests_get_params.py
python src/q08_requests_post.py
python src/q09_requests_put_delete.py
python src/q10_http_status_classifier.py
python src/q11_fetch_with_status_handling.py
# Mini CLI HTTP client
python src/q12_cli_http_client.py GET https://jsonplaceholder.typicode.com/posts/1
python src/q12_cli_http_client.py POST https://jsonplaceholder.typicode.com/posts '{"title":"x","body":"y","userId":1}'Scripts
q06βq09andq11βq12make real API calls β ensure internet access is available.
Run all scripts once to verify everything works:
python tests/smoke_tests.py