Boilerplate code for api integrations
Project description
AnyAPI
AnyAPI is a small library to get rid of boilerplate code reused in many projects where interaction with APIs is needed.
AnyAPI:
- uses
requests.Session - has default timeout
- has configurable pool size
- has retry policy in case of 429 error
- has
getandpostmethods defined
How to use
pip install anyapi2
from anyapi import API
class SomeServiceAPI(API):
BASE_URL = 'https://some-api-service.com'
some_service = SomeServiceAPI()
response = some_service.get('/v1/items')
response.raise_for_status()
result = response.json()
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
anyapi2-0.0.6.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anyapi2-0.0.6.tar.gz.
File metadata
- Download URL: anyapi2-0.0.6.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8385c3426d494519e42a0bd5163760b38bdcb17989e9ceee4202be0501586c59
|
|
| MD5 |
57a50e2a34672ff2ca502c61d27e1a37
|
|
| BLAKE2b-256 |
54c1d2b6a84b0daee1dc970d31f6ed589b946542502f05d68548ab75836cd747
|
File details
Details for the file anyapi2-0.0.6-py3-none-any.whl.
File metadata
- Download URL: anyapi2-0.0.6-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7474ba3bd8e087ef5476a2fad360fce2bc10360d4dd42e6fe64024e1975c41cc
|
|
| MD5 |
8606d1e2cd0f888afd60f7d82a86c6d7
|
|
| BLAKE2b-256 |
c016a9c7ad7ce3ba1cf3218c4d5e88a8ce54d9c96b4ebc0364359932bde7ec01
|