Skip to main content

getquantumrand — Python SDK

Quantum-seeded randomness from QuantumRand: a NIST DRBG seeded from real IBM quantum hardware, with every value labelled by the source that produced it.

Install

pip install getquantumrand

Quick Start

from getquantumrand import QuantumRandClient

qr = QuantumRandClient("qr_your_api_key")

# Generate 256 quantum random bits
bits = qr.bits(256)

# Random hex string
hex_str = qr.hex(128)

# Random integer in range
number = qr.integer(1, 100)

# Cryptographic key (AES-256)
key = qr.key(256)

# Batch: multiple values in one call
results = qr.batch([
    {"type": "bits", "params": {"n": 64}},
    {"type": "integer", "params": {"min": 1, "max": 6}},
    {"type": "integer", "params": {"min": 1, "max": 6}},
])

# Async webhook delivery
qr.webhook("https://your-app.com/webhook", type="key", params={"bits": 256})

# Usage stats
print(qr.stats())

Configuration

qr = QuantumRandClient(
    api_key="qr_your_key",
    base_url="https://quantumrand.dev",  # default
    backend=None,  # default: the server's quantum-seeded source
    timeout=30.0,
)

Leave backend unset to get the quantum-seeded default. Set it only to request a specific engine, e.g. "aer_simulator" (a simulator).

Where your randomness came from

Every response is labelled with its source. The client keeps the label of the most recent call:

key = qr.key(256)
print(qr.last_source)  # "quantum-seeded", or e.g. "csprng-fallback (...)"

If a fresh quantum seed is unavailable (for example, briefly after a restart), the service falls back to the operating system's secure generator and says so in this label.

Get a Free API Key

curl -X POST https://quantumrand.dev/keys/create \
  -H "Content-Type: application/json" \
  -d '{"name": "Your Name", "email": "you@example.com"}'

Metadata

Release files for getquantumrand 1.0.3

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

Source distribution (sdist)

Source distribution for getquantumrand 1.0.3
File Size Uploaded Provenance Actions
getquantumrand-1.0.3.tar.gz 6.5 kB Without provenance Details for getquantumrand-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for getquantumrand 1.0.3
File Interpreter ABI Platform Actions
getquantumrand-1.0.3-py3-none-any.whl Python 3 none any Details for getquantumrand-1.0.3-py3-none-any.whl

Total release size: 13.3 kB

Release files / getquantumrand-1.0.3.tar.gz

Download URL getquantumrand-1.0.3.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8ab70da131748676b219288c8461898b9b7d091c3218627f60b344c844f49ff0
BLAKE2b-256 checksum
How to use checksums
58027b5e861fd5ad2482962d3222d38be594fb3cf8083fca876b39e84004e578
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / getquantumrand-1.0.3-py3-none-any.whl

Download URL getquantumrand-1.0.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea68bbc125575807278a7781d425653bdb53fde6f86f168805d94045b110b244
BLAKE2b-256 checksum
How to use checksums
8bf2161c8e48cdf4a9dad9caa43400ecbf444a730deac5c7a934b4c038c9b239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Security for getquantumrand 1.0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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