Skip to main content

A Pythonic Rest API client

Project description

Restypy

Pythonic REST client

The code interacting with the remote API reads just like standard Python!

Restypy uses the awesome ‘requests’ library under the hood

NOTE

Since REST APIs may contain URLs that may be invalid method names in Python, you will have to use the path=‘1nvalidpath’ workaround to build the path. This approach is shown in the following example.

Examples

from restypy import API
github = API('https://api.github.com')
# GET : https://api.github.com/users/simula67/events
response = github.users(path='simula67').events()
# Response is a simple 'requests' response
print response.json()
# For HTTP methods other than GET, add a keyword argument 'method'. Rest of the arguments are passed to 'requests'
httpbin = API('http://httpbin.org')
print httpbin.post(method='post', data={'test': 'hi'}).text

Project details


Release history Release notifications

This version
History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
restypy-0.7.tar.gz (1.9 kB) Copy SHA256 hash SHA256 Source None Dec 31, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page