Skip to main content

Create API wrappers/clients in minutes, enjoying both blocking and async interfaces from one codebase!

Project description

Introduction

If you've ever tried to make an API wrapper you probably know that the code written can only be used as sync or async, well, not anymore.

Features

  • Lightweight: Extremely lightweight and minimal
  • Easy to use: Implement features in no time with the
  • Async and blocking: Provides both async and blocking calls
  • Test without a server: Since the library internally uses httpx, it can be used to test itself using an ASGI or WSGI application.
  • DRY: Don't repeat yourself, helps avoid code duplication and write reusable code
  • Routing: An APIRouter class with simliar API to APIClient
  • Modular: Create reusable routers that can be added to any client, independant of each other

Example Usage

from apiclient import APIClient, endpoint, Post

class CodeExecClient(APIClient):
  base_url = "https://pathtomysite.com/api/1.0"   # Note the missing / suffix
  @endpoint
  def run(self, language:str, code:str):
    # Do any processing with the data here!
    # Also note the / prefix in the url
    return Post("/execute", params={'lang':language, 'code':code})

Documentation is under works

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

instant-api-client-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

instant_api_client-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file instant-api-client-0.1.0.tar.gz.

File metadata

  • Download URL: instant-api-client-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for instant-api-client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59e43abf1ea8266fab78d3777baebb54525d2395d65b00a6835c97bcfa3857bd
MD5 caad38b926c37b10761197f7dc5573e5
BLAKE2b-256 77bef731d441f760e20b25e1b1b77659d87be282728c639ff4930ebcbc23411d

See more details on using hashes here.

File details

Details for the file instant_api_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: instant_api_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for instant_api_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13e6c0138edb74a034bb89e3e0a72f36fee7122c6e037cd22f23ec56c633a4ce
MD5 180876bd18f93b0821bea1bbe90f9eef
BLAKE2b-256 240b6c044f1b4dd524aae083b7b5a4a24bcaa6afbb70c2fbf690cef99f19afc2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page