CodeRigor

COURSE / REAL PRACTICE

A real API client

Build a bounded Python CLI client against a bundled loopback API: validated pages, retries, cancellation and a deterministic report.

Lessons & exercises7 authored lessons3 units
Start with the first lesson.

Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.

What you’ll work toward

Fetch paginated order fixtures from a real local HTTP server, validate every response and export a deterministic category report. Hosted exercises inject exchanges; real network work runs only in the downloadable loopback lab.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

This course builds on these skills:

Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.

A look inside the first lesson

Construct requests without string-splicing URLs

Python
from urllib.parse import quote, urlencode
segments = ["team/a", "orders"]
path = "/" + "/".join(quote(s,safe="") for s in segments)
query = urlencode([("tag","C++ & Python"),("tag","x/y")])
print(path)
print(query)

Your lesson sequence

Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.

UNIT 013 lessons Requests and response boundaries
  1. LESSON 01.01

    Construct requests without string-splicing URLs

    Encode path segments and ordered query pairs, preserve repeated parameters and keep header values out of URLs.

    Open lesson
  2. LESSON 01.02

    Bound response reads and always close them

    Pass explicit blocking-operation timeouts, cap accepted body bytes and close resources on success or failure.

    Open lesson
  3. LESSON 01.03

    Validate the page the endpoint promised

    Check status, media type, UTF-8, strict JSON and the application schema before accepting data.

    Open lesson
UNIT 023 lessons Pages, retries and concurrent work
  1. LESSON 02.01

    Paginate without loops or conflicting duplicates

    Follow opaque cursors, bound pages/items, deduplicate identical records and reject conflicting versions.

    Open lesson
  2. LESSON 02.02

    Retry only an explicitly repeatable operation

    Bound attempts and waits, distinguish transient failures from bad data and preserve cancellation before another request.

    Open lesson
  3. LESSON 02.03

    Bound concurrent work and preserve result order

    Use a fixed async worker pool, cancel and await sibling tasks on failure, and distinguish cooperative cancellation from stopping a socket.

    Open lesson
UNIT 031 lesson A working report client
  1. LESSON 03.01

    Fetch and export a deterministic category report

    Compose encoded requests, bounded reads, validated pages, safe retries and category concurrency into a working local CLI.

    Open lesson