Simple API Wrapper
Project description
Simple API Wrapper
Free software: BSD license
Documentation: https://apiwrapper.readthedocs.org.
Overview
Recently noticed a pattern and repeated pieces of code in Python API wrappers for simple requests and polling. A separate Python package will minimize code duplication and encourage de-coupling of logic from the API request functions.
Installation
At the command line:
$ easy_install apiwrapper
Or, if you have virtualenvwrapper installed:
$ mkvirtualenv apiwrapper $ pip install apiwrapper
Getting started
# as a helper class
from apiwrapper import APIWrapper
my_api = APIWrapper()
url = 'https://api.github.com/users/ardydedase/repos'
resp = my_api.make_request(url=url)
print(resp)
# as a parent class
class GithubAPI(APIWrapper):
def get_repos(self, username):
"""
Uses `make_request` method
"""
url = "https://api.github.com/users/{username}/repos".format(username=username)
return self.make_request(url, method='get', headers=None, data=None, callback=None)
History
0.1.0 (2015-01-11)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for apiwrapper-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 173de0ee01a85a2d9974a9fb87f593e18eef6305ec3ce007157c0fc345ce6ce8 |
|
MD5 | 9aca222d8bd19275ed849b9e4a66d67c |
|
BLAKE2b-256 | 2ace4267ab2f99a226bb1a508bdf292eab6d277afb2a48c513ae8ca4461066c8 |