PythonrequestsCSVJSONAdvanced~7hPart 6 of 6

Python Reach

Data you did not make

Everything your programs have used so far, you wrote. This is the part where it arrives from a file somebody else exported and a service that owes you nothing: read the documentation, ask for exactly what you need, check it before you trust it, and keep working when the answer never comes.

Modules
7
Drills
15
Build steps
10
Time
~7h

Walk out with

A weekly forecast report, built from a messy locations file and a live service, that still produces a useful answer while three separate things go wrong.

What you'll do

01

The file you were handed

Convert it, reject what will not, and say why.

02

Down into the document

Walk a nested response and find what is missing.

03

Design the request

A parameter table, a requirement, and no finished URL.

04

Survive the outside world

Bound the wait, name the failure, answer anyway.

The pitch

What you practise, and what you leave with

A weekly forecast report from a messy locations file and a live service, surviving three deliberate failures without a traceback.

You will practise

  • Say how many rows survive conversion
  • Predict a response before calling
  • Decide if a retry is safe, and what it costs
  • Write the line from memory, at speed

Afterwards you can

  • Design a request from documentation
  • Validate data before trusting it
  • Bound every call your program makes
  • Produce an answer when things fail

Modules

7 modules, 39 items

Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.

  1. 1

    The file you were handed

    ~55 min

    A file that looks fine and is not, and a policy for the rows that are not.

    • LessonThe file hands you strings8 min
    • LessonA policy for the rows that fail6 min
    • DrillHow many rows survive12 min
    • DrillWhich rule rejects this row11 min
    • Build stepSplit the good from the bad18 min
  2. 2

    Down into the document

    ~51 min

    Walk a nested response, and tell missing from null from empty.

    • LessonWhat the document parsed into7 min
    • LessonArrays joined by position only6 min
    • DrillWhat is at this path12 min
    • DrillMissing, null, or empty12 min
    • Build stepFlatten it into records14 min
  3. 3

    The call and the answer

    ~1h

    One request, end to end, and the two successes that are not the same.

    • LessonParameters are data, not text7 min
    • LessonRead the envelope first7 min
    • Build stepMake the call yourself14 min
    • LessonTwo successes that are not6 min
    • LessonThree questions, in order6 min
    • DrillWhat the response asks for12 min
    • DrillDecoded, or actually answered11 min
    • DrillSpell the line that reaches out14 min
  4. 4

    Read the docs, get the data

    ~1h

    A requirement, a parameter table, and no finished URL anywhere.

    • LessonFrom a requirement to a request7 min
    • LessonPredict before you press send5 min
    • DrillWhich request answers this12 min
    • DrillPredict the response shape12 min
    • Build stepDesign the request yourself16 min
    • DrillHow many requests is that12 min
  5. 5

    Assume it lies

    ~54 min

    The response parsed. Now find out whether any of it can be used.

    • LessonCheck it at the boundary8 min
    • LessonWhat comes out the far side7 min
    • DrillHow many records pass12 min
    • DrillWrite the rejection11 min
    • Build stepTurn a batch into records16 min
  6. 6

    When it doesn't answer

    ~1h

    Bound the wait, name the failure, and decide whether to ask again.

    • LessonBound how long you will wait7 min
    • LessonRetrying, and what it costs6 min
    • DrillName the failure12 min
    • DrillIs it safe to send again12 min
    • DrillWhat the retry budget costs12 min
    • Build stepProvoke three failures16 min
  7. 7

    The build

    ~1h

    A messy file, an address, no labels, and three things that go wrong.

    • Build stepPlan it before you write it12 min
    • Build stepFetch it once, keep it18 min
    • Build stepTransform with the wire unplugged16 min
    • Build stepMake it survive three failures20 min

The data is outside. Go and get it.

The first item is free. ~7h of focused work, at your own pace.

Advanced~7h7 modules