No project description provided
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file derapi-0.1.2.tar.gz
.
File metadata
- Download URL: derapi-0.1.2.tar.gz
- Upload date:
- Size: 50.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7213d0f7aed9402c2fa52c816298c59ce0902cdd3e8f14d8cf30d7ea1951d83 |
|
MD5 | 4a7b35c8c90d8d5d2eb99826cdb9f9b3 |
|
BLAKE2b-256 | f0069776f6c54bf5a9f94a299ba4c3a65f9d3312c782c69173befcf54f5ef524 |
Provenance
The following attestation bundles were made for derapi-0.1.2.tar.gz
:
Publisher:
publish.yaml
on derapi/derapi-python
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
derapi-0.1.2.tar.gz
- Subject digest:
c7213d0f7aed9402c2fa52c816298c59ce0902cdd3e8f14d8cf30d7ea1951d83
- Sigstore transparency entry: 150643699
- Sigstore integration time:
- Permalink:
derapi/derapi-python@c1f4245f916048c669f5b55875470f9fc62873b6
- Branch / Tag:
refs/tags/v0.1.2
- Owner: https://github.com/derapi
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@c1f4245f916048c669f5b55875470f9fc62873b6
- Trigger Event:
release
- Statement type:
File details
Details for the file derapi-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: derapi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 153.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 435e337dffdaa5222ea665dde20dd5a63c15796d700ed76f7e527e47186b2156 |
|
MD5 | cdb698e394aa035a40a7ae27d5eadce6 |
|
BLAKE2b-256 | bf48a0b4f86eb5a016a4019da9faa2ca6123e424131325fa1ae82cc7eef72fdb |
Provenance
The following attestation bundles were made for derapi-0.1.2-py3-none-any.whl
:
Publisher:
publish.yaml
on derapi/derapi-python
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
derapi-0.1.2-py3-none-any.whl
- Subject digest:
435e337dffdaa5222ea665dde20dd5a63c15796d700ed76f7e527e47186b2156
- Sigstore transparency entry: 150643701
- Sigstore integration time:
- Permalink:
derapi/derapi-python@c1f4245f916048c669f5b55875470f9fc62873b6
- Branch / Tag:
refs/tags/v0.1.2
- Owner: https://github.com/derapi
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@c1f4245f916048c669f5b55875470f9fc62873b6
- Trigger Event:
release
- Statement type: