Skip to main content

Subnoto Python SDK

Python client for the Subnoto Public API.

Table of contents

Installation

Requirements: Python 3.9+

Install from PyPI:

pip install subnoto-api-client

Usage

The SDK provides both async and sync clients. Use SubnotoClient for async/await code or SubnotoSyncClient for synchronous code. Credentials are required; you can pass them explicitly or set SUBNOTO_ACCESS_KEY and SUBNOTO_SECRET_KEY.

Async Example

import asyncio
from subnoto_api_client import SubnotoClient, SubnotoConfig

async def main():
    async with SubnotoClient(SubnotoConfig()) as client:
        response = await client.post("/public/workspace/list", json={})
        print(f"Workspaces: {response.json()}")

if __name__ == "__main__":
    asyncio.run(main())

Sync Example

from subnoto_api_client import SubnotoSyncClient, SubnotoConfig

with SubnotoSyncClient(SubnotoConfig()) as client:
    response = client.post("/public/workspace/list", json={})
    print(f"Workspaces: {response.json()}")

Configuration

Option Type Required Description
access_key str Yes API access key (or set env var SUBNOTO_ACCESS_KEY)
secret_key str Yes API secret key, hex-encoded (or set env var SUBNOTO_SECRET_KEY)

Error handling and tunnel retry

The SDK follows the Subnoto error reference. On tunnel 401 errors (TUNNEL_SESSION_NOT_FOUND or TUNNEL_ERROR), the client automatically invalidates the tunnel session and retries the request up to 3 times with a new session. You do not need to manage tunnel lifecycle when using SubnotoClient or SubnotoSyncClient.

For custom handling you can use the exported helpers and codes. You can raise SubnotoError(message, response.status_code) with the response body message and status code.

from subnoto_api_client import (
    SubnotoClient,
    SubnotoConfig,
    get_error_code,
    is_tunnel_error,
    SubnotoError,
    TUNNEL_SESSION_NOT_FOUND,
    TUNNEL_ERROR,
)

async def main():
    async with SubnotoClient(SubnotoConfig()) as client:
        response = await client.post("/public/utils/whoami", json={})
        if response.status_code != 200:
            body = response.json()
            code = get_error_code(body)  # works with API shape (error.code) and top-level code
            if is_tunnel_error(body):
                # SDK already retried (up to 3 times); this is the result after retries
                pass
            msg = body.get("error", {}).get("message", str(body)) if isinstance(body, dict) else str(body)
            raise SubnotoError(msg, response.status_code)

See the Subnoto error reference for all error codes.

Documentation

The API documentation is available here.

Metadata

Release files for subnoto-api-client 2.17.0

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

Built distributions (wheels)

Table of built distributions (wheels) for subnoto-api-client 2.17.0
File Actions
subnoto_api_client-2.17.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for subnoto_api_client-2.17.0-cp311-abi3-win_amd64.whl
subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_x86_64.whl
subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_aarch64.whl
subnoto_api_client-2.17.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for subnoto_api_client-2.17.0-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 8.3 MB

Release files / subnoto_api_client-2.17.0-cp311-abi3-win_amd64.whl

Download URL subnoto_api_client-2.17.0-cp311-abi3-win_amd64.whl
Size 2.0 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
26fd9150746ba7ec32a154a59912b2d33372ea7103244e07391a228752bd283c
BLAKE2b-256 checksum
How to use checksums
13707e42639d359c2818d1d6556a372a0e7ad3de2da3e8f9e3ee33a91427029b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.11

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 GitLab CI/CD, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_x86_64.whl

Download URL subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_x86_64.whl
Size 2.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bcfc9431279d8aa5e0d1e76835bcb8f9339ed938db72db8983bada61ba77d3cf
BLAKE2b-256 checksum
How to use checksums
6d73d1939b107f0a215c63d7dcf9ed846dff7d5d1547d11abf82e65a4cc96c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.11

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 GitLab CI/CD, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_aarch64.whl

Download URL subnoto_api_client-2.17.0-cp311-abi3-manylinux2014_aarch64.whl
Size 2.0 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
dd62088cc2dfa93f0140c806698cbe6b626a933b47418369678323c1583f3b64
BLAKE2b-256 checksum
How to use checksums
d7e387c7969d8e1f8585703ccf90c7e7b3ce4a05ed9ae7e0f3e8a2948a368476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.11

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 GitLab CI/CD, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / subnoto_api_client-2.17.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL subnoto_api_client-2.17.0-cp311-abi3-macosx_11_0_arm64.whl
Size 2.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
38293bd498f95e54c7ba9a68af87689dc413a4ec92a00ca6b828e76bee88bfd5
BLAKE2b-256 checksum
How to use checksums
ddb49370cfe00ac1f295cd70f7feff6c013afe3b50c149987696b43e4bda4fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.11

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 GitLab CI/CD, verified by PyPI on Oct 28, 2026.

Transparency log

Security for subnoto-api-client 2.17.0

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for subnoto_api_client-2.17.0-cp311-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.17.0 This release

4 release files Full provenance

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