Skip to main content

A Universal REST api client for python.

Project description

A Universal REST api client for python.

Full documentation at: https://universal-client.readthedocs.org/en/latest/

Universal Client is a Apache 2 licensed client for quickly and easily interacting with any REST api.

You want to use a cool api, but the python client doesn’t exist, or is out of date, or doesn’t support the feature you want to use. So you start making raw HTTP requests but, even with the best HTTP library, passing in the right URL and options for every call is error prone and quickly becomes cumbersome for anything more than trivial scenarios.

The Universal Client is a wrapper around the excellent Requests HTTP library. A Client instance corresponds to a single endpoint in the api. use dot notation to navigate the api paths. You can set any Requests parameters on a client instance and all child instances will inherit those parameters.

A quick example:

>>> from universalclient import Client
# create a client pointing to google
>>> google = Client("http://google.com")
# set a google cookie so we get "personalized" results (Yay!)
>>> google = google.setArgs(cookies={"gv": "5d41402abc4b2a76b9719d911017c592"})
# get the google home page at http://google.com
>>> resp = google.get()
# create an end point to google images, which inherits the cookies
>>> images = google.images
# get google site at http://google.com/images
>>> resp = images.get()

The Client stores a complete api call. It is immutable - any modification returns a new client. This allows you to reuse endpoints over and over.

Universal Client features:
  • oauth support through rauth

  • string formatting for URLs

  • supports every argument supported by Requests

  • custom data formatting for POST requests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

UniversalClient-0.5.0.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file UniversalClient-0.5.0.tar.gz.

File metadata

File hashes

Hashes for UniversalClient-0.5.0.tar.gz
Algorithm Hash digest
SHA256 805c960651195a370d3897c1d19f4a40b9a7c8128dcb712e1d4a54e67fa3b9d5
MD5 7ac62ec08ac5b585a90a695c5bc46230
BLAKE2b-256 808f6e2a1e202b43c21ab00bb2d1ddf7dc2c08126d7c595ebb1d9ea75aea0546

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page