Skip to main content

No project description provided

Project description

api-lib Format and tests cov

A lightweight Python library for building and consuming APIs with ease.

Features

  • Simple API client utilities
  • Built-in request/response handling
  • Extensible and easy to integrate

Installation

It's recommended to use uv to install the package:

uv add api-lib

Usage

Example: Consuming an API

from api_lib import ApiLib
from api_lib.headers.accept import AcceptGithub
from api_lib.headers.authorization import Bearer
from api_lib.method import Method

from .response import Repository, User

class GithubAPI(ApiLib):
    headers = [AcceptGithub()]

    async def user(self) -> User:
        return await self.req(Method.GET, "/user", User)


api = GithubAPI("https://api.github.com", Bearer(env_var="GITHUB_TOKEN"))

user = await gh_api.user()

Documentation

See the full documentation for more details and advanced usage.

Contributing

Contributions are welcome! Please open issues or submit pull requests.

License

This project is licensed under the MIT License.

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

api_lib-0.0.3.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

api_lib-0.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file api_lib-0.0.3.tar.gz.

File metadata

  • Download URL: api_lib-0.0.3.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for api_lib-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9db9e26bd762793bde4b5ee7073264483871b60cc9f54e05bf265df460e7fd0b
MD5 942ba5b5a4b46f710dd4ffebea80414b
BLAKE2b-256 04ae0e87a80ed134b8b288d695c13e23d4f149e6e777d8591f7c6f2b247b9783

See more details on using hashes here.

Provenance

The following attestation bundles were made for api_lib-0.0.3.tar.gz:

Publisher: publish.yaml on jeandemeusy/api-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file api_lib-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: api_lib-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for api_lib-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f1d0107938fa83caca9f41c2320c3a417575e485f5147553b7805b9415f2ee7
MD5 6c826f169866ed3a93663d15a2d96963
BLAKE2b-256 6af990b8029ae16b58f70394c1b34f0cfc823a3cd8422a3b6e32af285d5acedc

See more details on using hashes here.

Provenance

The following attestation bundles were made for api_lib-0.0.3-py3-none-any.whl:

Publisher: publish.yaml on jeandemeusy/api-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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