8000 GitHub - 0xE111/anyapi: Boilerplate code for API integrations · GitHub
[go: up one dir, main page]

Skip to content
0xE111Public

About

Boilerplate code for API integrations

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 get and post methods 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()

About

Boilerplate code for API integrations

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0