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 that I’ve worked on. A separate Python package will minimize code duplication and encourage de-coupling of logic from the API request functions.
Features
Simple and straightforward.
Can be used as a parent class or as a helper class.
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 from apiwrapper import APIWrapper
- 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 Distribution
Built Distribution
Hashes for apiwrapper-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d750cf6466aff2e77e26b086f2206b347591d396e3582a2088f7e7bfb9cc5c |
|
MD5 | 86dcb899380805b33d2198bcd7ee0dc3 |
|
BLAKE2b-256 | 3ad3f633cac965e8c4738417c761d604a6e4dc5ed0fe20ffc8619d30b7348a55 |