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.1.tar.gz (49.5 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.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: api_lib-0.0.1.tar.gz
  • Upload date:
  • Size: 49.5 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.1.tar.gz
Algorithm Hash digest
SHA256 15661058c9403d5ad18c37375879cdea249ebc337b1e3b957415a9b32d0a20b0
MD5 36afb5bbdaf5680c8ce6978711f2635d
BLAKE2b-256 00566be8a366e25fe6fad6ababbe10c4051dc1222d7a35a2b86e1f8f6bc6dd50

See more details on using hashes here.

Provenance

The following attestation bundles were made for api_lib-0.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: api_lib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bff1eff908d1fbf01e0fcc782ee2dc96aab4054d5afce9a23e5e623f6fdceb1c
MD5 6fe56c12d14126744a472facc3d18e94
BLAKE2b-256 f44e0c7a1014c3b88b33014d989725000518f031cebde50376d5d199eba0db0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for api_lib-0.0.1-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