Skip to main content

Quantumize Python SDK

A typed Python client for the Quantumize post-quantum cryptography API. Supports both sync (httpx) and async usage.

Installation

pip install quantumize-sdk

Or install directly from source:

pip install ./sdk/python

Requirements: Python ≥ 3.9, httpx ≥ 0.24.0

Quick Start

from quantumize import QuantumizeClient

# 1. Initialise the client with your API key
client = QuantumizeClient(api_key="qtz_k_your_key_here")

# 2. Encrypt a file
with open("report.pdf", "rb") as f:
    result = client.encrypt_file(f, "report.pdf", algo="kyber768")

# 3. The encrypted artifact and decryption key are now stored in Quantumize
print("Encrypted file:", result.encrypted_file_name)
print("Decryption key:", result.private_decryption_key_name)

# 4. List your files
files = client.list_files()
for file in files:
    print(file.name, "•", "encrypted" if file.encrypted else "plaintext")

# 5. Check your account and credit balance
account = client.get_account()
print(f"Credits remaining: {account.credits}")

Generate an API key at Account Settings → API Keys in the dashboard, or via POST /api/v1/api-keys. The full key value is shown only once — store it in an environment variable or a secrets manager.


Authentication

All requests authenticate via the X-API-Key header:

client = QuantumizeClient(api_key="qtz_k_...")

For on-premise / enterprise deployments behind a firewall, pass your internal base URL:

client = QuantumizeClient(
    api_key="qtz_k_...",
    base_url="https://pqc.internal.acme.com",
)

Core Methods

Cryptographic Operations

Method Description Credits
encrypt_file(file, filename, algo, parent_id) Encrypt with a post-quantum KEM 2
decrypt_file(encrypted_file, key, algo, record_id) Decrypt using the stored key 0
sign_file(file, filename, algo, parent_id) Sign with a post-quantum DSA 2
verify_file(sig_file, pub_key, algo, record_id) Verify a signature 0

File Management

Method Description
list_files(parent_id=None) List files/folders (root or in a folder)

Account & Platform

Method Description
get_account() Get profile + credit balance
get_algorithms() List all supported PQC algorithms
list_api_keys() List API keys for this account
create_api_key(name, expires_at) Create a new API key
revoke_api_key(key_id) Revoke an API key

Algorithms

Fetch available algorithms at runtime:

algos = client.get_algorithms()
kem_algos = [a for a in algos if a.type == "KEM"]
dsa_algos = [a for a in algos if a.type == "DSA"]

for algo in kem_algos:
    print(f"{algo.name:30s}  Security Level {algo.security_level}  {algo.nist_status}")

Common KEM algorithms: kyber512, kyber768 (default), kyber1024, mceliece348864, hqc-128, hqc-192, hqc-256

Common DSA algorithms: dilithium2 (default), dilithium3, dilithium5, falcon-512, falcon-1024, sphincs-sha2-128f


Async Usage

import asyncio
from quantumize import AsyncQuantumizeClient

async def main():
    async with AsyncQuantumizeClient(api_key="qtz_k_...") as client:
        # Encrypt a file asynchronously
        with open("contract.docx", "rb") as f:
            result = await client.encrypt_file(f, "contract.docx", algo="kyber1024")

        print("Encrypted:", result.encrypted_file_name)

        # List supported algorithms
        algos = await client.get_algorithms()
        print(f"{len(algos)} algorithms available")

asyncio.run(main())

Error Handling

from quantumize import (
    QuantumizeClient,
    AuthenticationError,
    InsufficientCreditsError,
    VerificationError,
)

client = QuantumizeClient(api_key="qtz_k_...")

try:
    result = client.encrypt_file(open("data.bin", "rb"), "data.bin")
except InsufficientCreditsError:
    print("Not enough credits — top up at quantumize.io/billing")
except AuthenticationError:
    print("Invalid or revoked API key")
Exception HTTP Cause
AuthenticationError 401 Invalid / revoked API key or token
AuthorizationError 403 Admin-only endpoint
NotFoundError 404 Record / key not found
ValidationError 400 / 422 Bad request parameters
InsufficientCreditsError 402 Too few credits
RateLimitError 429 Request rate exceeded
VerificationError 422 Signature verification failed
ServerError 5xx Unexpected server error

OpenAPI Specification

The full machine-readable API contract is available at:

GET /api/v1/openapi.json

Or download the YAML source from the repository at docs/api/openapi.yaml.


License

Proprietary — © Quantumize Platform. All rights reserved.

Download files

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

Source Distribution

quantumize_sdk-1.0.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

quantumize_sdk-1.0.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file quantumize_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: quantumize_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for quantumize_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 407fa0d505645b2bd7b88ae76d3379945cce53256b81ca3e6c47a4a7111a5159
MD5 2a631eb694284183e61d11ff4426bf9a
BLAKE2b-256 f81f0cf41d6c0399769f210bb37c2f8feafba50bcc6fc70c4ab1a2eb67d431d0

See more details on using hashes here.

File details

Details for the file quantumize_sdk-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: quantumize_sdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for quantumize_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c0450d1a9524b8c09d8f31e22e7f082622290d98ac9da327b16bea5396e6a85
MD5 91d6f4a9f77127c347e19190ebfea9a9
BLAKE2b-256 c4aa4b6c5eab46e15188f743c79dd8122f17ec0e67ebb1b178eda671d5ad50a0

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