Skip to content

Practice: covering Python OOP concepts, HTTP requests with requests library, and a mini CLI tool for API interactions.

Notifications You must be signed in to change notification settings

raniartii/Api_Calls_Python_OOPs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python OOP & HTTP Practice

A compact project exploring Python OOP fundamentals, HTTP requests with requests, and a mini CLI client for API interactions.


πŸ“¦ Prerequisites

  • Python 3.10+
  • Internet access (for API calls via JSONPlaceholder)
  • pip (package manager)

βš™οΈ Setup (with Virtual Environment)

# Linux/macOS
python3 -m venv .venv
source .venv/bin/activate

# Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1

pip install -r requirements.txt

If your system Python is 3.10+, you can use python instead of python3.


πŸš€ Run Scripts

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–q09 and q11–q12 make real API calls β€” ensure internet access is available.


βœ… Optional: Smoke Tests

Run all scripts once to verify everything works:

python tests/smoke_tests.py

About

Practice: covering Python OOP concepts, HTTP requests with requests library, and a mini CLI tool for API interactions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages