~/talk

Designing Pythonic APIs

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [api-design, python]
links:none on file
slides:none on file

Compares requests vs urllib-style APIs across five concrete use cases and shows why requests wins: top-level exports and explicit verbs make code shorter; response objects give a useful repr and a direct status_code attribute instead of a getter; error handling offers an optional raise_for_status instead of forcing exceptions; JSON support is baked in via a json= parameter; auth accepts plain Python types and sessions scale from one-off to persistent. Live code examples and a mock HTTP service prove each point.

AI-written summary · about

  1. 0:00Introduction to Pythonic APIs
  2. 1:56Why good package interfaces matter
  3. 3:46Comparing requests and urllib
  4. 6:04Top-level imports and explicit methods
  5. 11:45Handling status codes
  6. 13:56Encapsulation with properties
  7. 15:26Error handling strategies
  8. 16:51Encoding and decoding requests
  9. 19:27Sending authenticated requests
  10. 24:53Python standard library vs third-party APIs
  11. 25:15Q&A and closing remarks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.