Skip to main content

ONEKEY API Client

This is the official Python client for the ONEKEY public API.

Usage

First, you have to log in and select a tenant:

from onekey_client import Client

YOUR_API_URL = "https://demo.onekey.com/api"

client = Client(api_url=YOUR_API_URL)

client.login(EMAIL, PASSWORD)
tenant = client.get_tenant("Environment name")
client.use_tenant(tenant)

After you logged in and selected the tenant, you can query the GraphQL API

GET_ALL_FIRMWARES = """
query {
  allFirmwares {
    id
    name
  }
}
"""
res = client.query(GET_ALL_FIRMWARES)
print(res)

GET_PRODUCT_GROUPS = """
query {
  allProductGroups {
    id
    name
  }
}
"""
res = client.query(GET_PRODUCT_GROUPS)
default_product_group = next(pg for pg in res["allProductGroups"] if pg["name"] == "Default")

You can upload firmwares:

metadata = FirmwareMetadata(
    name="myFirmware",
    vendor_name="myVendor",
    product_name="myProduct",
    product_group_id=default_product_group["id"],
)

firmware_path = Path("/path/to/firmware.bin")
res = client.upload_firmware(metadata, firmware_path, enable_monitoring=True)
print(res)

Support

You can create a new issue in this repo or contact us at support@onekey.com.

Metadata

Release files for onekey-client 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onekey-client 2.1.0
File Size Uploaded
onekey_client-2.1.0.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onekey-client 2.1.0
File Interpreter ABI Platform
onekey_client-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.0 kB

Release files / onekey_client-2.1.0.tar.gz

Download URL onekey_client-2.1.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e11a4df4de27cc7b873e5cd1a97ae48430b7ef298dc971075cdc4300b3cb24c6
BLAKE2b-256 checksum
How to use checksums
42ddad146093c37acb86b86cf690b1b836ca3676e2619cda126e5429b4b7dc1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-1034-azure

Release files / onekey_client-2.1.0-py3-none-any.whl

Download URL onekey_client-2.1.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8c521dc477137a0a2ac50abe1520cce2d935464ceec5d446d723d9b08b71521
BLAKE2b-256 checksum
How to use checksums
e13579c53b949029c34910b41b388e269599c42e98d36a934bc8752adfe8d9a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-1034-azure

Release history Release notifications | RSS feed

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

This release

2.1.0 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page