derapi
The derapi Python SDK provides access to the Derapi API for Python
applications -- fully typed with async support.
The SDK closely mirrors our API, so the API documentation is a helpful reference when using it in your project.
Table of Contents
Installation
pip install derapi
Usage
Client initialization
import os
import httpx
from derapi import AuthenticatedClient
def init_client() -> AuthenticatedClient:
token_resp = httpx.post(
"https://auth.derapi.com/oauth2/token",
auth=(os.environ["DERAPI_CLIENT_ID"], os.environ["DERAPI_CLIENT_SECRET"]),
data={"grant_type": "client_credentials"},
)
token_resp.raise_for_status()
token = token_resp.json()["access_token"]
return AuthenticatedClient(
base_url="https://api.derapi.com",
raise_on_unexpected_status=True,
token=token,
)
Example: Retrieve a list of Sites synchronously, iterating through all pages of results automatically
...
from derapi.api.sites import list_sites
client = init_client()
for site in list_sites.sync_depaginated(client=client):
print(site.id)
License
derapi is distributed under the terms of the MIT license.
Metadata
Release files for derapi 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| derapi-0.1.2.tar.gz | 50.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| derapi-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 204.0 kB
Release files / derapi-0.1.2.tar.gz
| Download URL | derapi-0.1.2.tar.gz |
|---|---|
| Size | 50.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7213d0f7aed9402c2fa52c816298c59ce0902cdd3e8f14d8cf30d7ea1951d83
|
|
BLAKE2b-256 checksum How to use checksums |
f0069776f6c54bf5a9f94a299ba4c3a65f9d3312c782c69173befcf54f5ef524
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.
Transparency logRelease files / derapi-0.1.2-py3-none-any.whl
| Download URL | derapi-0.1.2-py3-none-any.whl |
|---|---|
| Size | 153.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
435e337dffdaa5222ea665dde20dd5a63c15796d700ed76f7e527e47186b2156
|
|
BLAKE2b-256 checksum How to use checksums |
bf48a0b4f86eb5a016a4019da9faa2ca6123e424131325fa1ae82cc7eef72fdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.
Transparency log