Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rebyte-0.0.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

rebyte-0.0.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rebyte-0.0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for rebyte-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5c5ae7cb5f15945b337c2854e3bd2b7115ee89d201cfdcf3b4084a8e23170b1f
MD5 8a0abd6633f3964c255dd2d79a03376a
BLAKE2b-256 08c5afb1303815832929854f8e21065c14b03f20c5ff7f74d116939d39b01a44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rebyte-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for rebyte-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fdec3348bd08ae0c8919eb9254a42b3a6dd48ad5918fb7f27690a4587e0c65ed
MD5 44dc1aca65eaf1ffd915db371ff54a43
BLAKE2b-256 80d56cdc26c1fe3a876e1adbb6d1c4db9a3237d1efc66ff8971b18b224a15492

See more details on using hashes here.

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