Welcome to the api REST API Integration Module. This module provides a clean 3-tier pedagogical architecture for mastering HTTP REST API interaction, JSON data extraction, object-oriented API client design, range-driven pagination, dir(range) runtime introspection, and historical version evolution notes from Python 2.7 to 3.13.
api/
βββ 01_fundamentals/
β βββ basic_api_requests.py # HTTP GET requests via urllib, status code checking, JSON formatting
β βββ test_fundamentals.py # Unittest suite mocking urllib HTTP requests
βββ 02_advanced_rest_and_endpoints/
β βββ advanced_api_client.py # Object-oriented PokeApiClient class, endpoint routing, custom exceptions
β βββ test_advanced.py # Unittest suite mocking multi-endpoint requests & error handling
βββ 03_range_evolution_and_performance/
β βββ range_api_pagination.py # Range sequence pagination, O(1) memory benchmarking, dir(range) matrix
β βββ test_range_evolution.py # Unittest suite for range offset generator & reflection
βββ test_api_master.py # Master unittest runner executing all 3 sub-tier test suites
βββ README.md # Module documentation & usage guide
Execute basic iTunes API search:
python3 api/01_fundamentals/basic_api_requests.pyExecute object-oriented PokΓ©API client:
python3 api/02_advanced_rest_and_endpoints/advanced_api_client.pySimulate range offset API pagination and memory benchmarks:
python3 api/03_range_evolution_and_performance/range_api_pagination.pyRun the master test runner from the root repository directory:
python3 api/test_api_master.pyOr execute individual test suites:
python3 -m unittest discover -s api/01_fundamentals -p "test_*.py"
python3 -m unittest discover -s api/02_advanced_rest_and_endpoints -p "test_*.py"
python3 -m unittest discover -s api/03_range_evolution_and_performance -p "test_*.py"| Sub-Tier | Primary Features Covered | Code File | Unit Test File |
|---|---|---|---|
| 01_fundamentals | HTTP GET, urllib.request, JSON decoding, query parameter encoding, error handling |
basic_api_requests.py |
test_fundamentals.py |
| 02_advanced_rest_and_endpoints | OOP client (PokeApiClient), multi-endpoint routing (/pokemon, /ability), PokeApiError
|
advanced_api_client.py |
test_advanced.py |
| 03_range_evolution_and_performance | Range offset pagination, dir(range) matrix, Py 2.7 to 3.13 history |
range_api_pagination.py |
test_range_evolution.py |