Skip to content

Instantly share code, notes, and snippets.

@issackelly
Created April 28, 2011 19:16
Show Gist options
  • Save issackelly/947085 to your computer and use it in GitHub Desktop.
Save issackelly/947085 to your computer and use it in GitHub Desktop.
Beginning API Consumption

Consuming Web APIs with Python

Type:Talk
Presenter:Issac Kelly issac@kellycreativetech.com
Python level:beginner

Description

Issac will go over the basics of HTTP apis, what to look for, basic authorization methods, and how to interface with them in your python scripts. There will not be cake.

Extended description

I would like to cover the basics of writing python to interface with web based apis. I won't be doing any live coding, but rather gradually increase an example program to implement a client for an api like convore.com or FreshBooks or PayPal. I'm going to focus on REST apis, and explain briefly why they're totally superior.

Outline

% indicators are the percent of the talk I plan on devoting to each main topic.

  1. API Formats (10%)

    1. REST-The architecture of HTTP
      1. stateless
      2. Good URLs
      3. Prior Knowledge
    2. SOAP-The other one.
      """ This area definitely needs more thought, but I've got 3 projects with SOAP apis due before PyOhio, so I'm sure I'll have enough material for a minute or two. """ 1. Ignore HTTP 2. ... 3. Profit
  2. REST Conventions (25%)

    1. Authorization
      1. HTTP Authentication
      2. OAuth
    2. One URL per resource
    3. Trust your verbs
    4. Trust your HTTP Codes
    5. Data Formats
    6. Headers
  3. Consuming with Python (50%)

  1. Libraries
    1. stdlib - urllib and urllib2
    2. requests
  2. Authorization
    1. HTTP Authorization
    2. OAuth
  3. Getting Information Out
  4. Mapping to Python
  5. Putting Information Back In
  1. Breaking REST and into the Unknown (15%)
  1. Long Polling
  2. Websocket
  3. Stateful URLs

Bio

Issac Kelly is the lead developer and a partner at Kelly Creative Tech in Columbus. He writes Python for the web almost exclusively. He's written REST APIs projects like http://www.kellycreativetech.com/re/, http://shotblox.com, http://chariotapp.com, and http://arraslife.com, and an HTTP enabled light switch. He's also written API clients for FreshBooks, Convore, and dozens more.

Recording release

I will sign the recording release agreement (text at http://wiki.python.org/moin/PyOhio/RecordingRelease).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment