Python client library for the Rebyte API
Project description
Rebyte Python Library
The Rebyte Python library provides convenient access to the Rebyte API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Rebyte API.
Installation
To start, ensure you have Python 3.7.1 or newer. If you just want to use the package, run:
pip install --upgrade rebyte
After you have installed the package, import it at the top of a file:
import rebyte
To install this package from source to make modifications to it, run the following command from the root of the repository:
python setup.py install
Usage
The library needs to be configured with your account's secret key which is available on the website.
Call callable
from rebyte import RebyteAPIRequestor
requestor = RebyteAPIRequestor(
key=<your api_key>,
api_base=<rebyte endpoint, default to https://rebyte.ai>
)
path = f'/api/sdk/p/{your project_id}/a/{your callable_id}/r'
res, _, _ = requestor.request(
method="POST",
stream=False, # or True
url=path,
params=data
)
print(res)
Async API
Async support is available in the API by prepending a to a network-bound method:
from rebyte import RebyteAPIRequestor
requestor = RebyteAPIRequestor(
key=<your api_key>,
api_base=<rebyte endpoint, default to https://rebyte.ai>
)
path = f'/api/sdk/p/{your project_id}/a/{your callable_id}/r'
res, _, _ = await requestor.arequest(
method="POST",
stream=False, # or True
url=path,
params=data
)
print(res)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rebyte-0.0.2.tar.gz.
File metadata
- Download URL: rebyte-0.0.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd986b2248c58866dcfa8880bbebbbef7d11bc8f1cd2db520c51df1db9769986
|
|
| MD5 |
17ee26d0da06136a969073260f364541
|
|
| BLAKE2b-256 |
2b7a60407fcb64d1690538cda9ce5babbac2ab434417511c5493ed4703443177
|
File details
Details for the file rebyte-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rebyte-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c0d563b61e8ce0595cd4bcc243cbc7725b82325f8e2ca7224620ca0e4368bee
|
|
| MD5 |
1c669ef083a1392b8987f41cd7a68c82
|
|
| BLAKE2b-256 |
bf924a60cf5700763facffb0db470a9e999809b1d64d9136b1614ac357eb20f2
|