Skip to main content

Official PostQ SDK for Python — submit quantum-risk scans and read results from the PostQ API.

Project description

postq-sdk

Official PostQ SDK for Python. Submit quantum-risk scans and read results from the PostQ API.

pip install postq-sdk

Quickstart

from postq import PostQ, Finding

pq = PostQ(api_key="pq_live_…")  # or set POSTQ_API_KEY env var

# Submit a scan
result = pq.scans.submit(
    type="url",
    target="example.com",
    risk_score=85,
    risk_level="High",
    findings=[
        Finding(severity="high", title="RSA-2048 public key"),
    ],
)
print(result.url)  # https://app.postq.dev/scans/...

# List recent scans
for scan in pq.scans.list(limit=10):
    print(scan.target, scan.risk_level)

# Iterate every scan with automatic pagination
for scan in pq.scans.iter_all():
    ...

Assets and keys (0.3.0+)

# Browse your cryptographic inventory
assets = pq.assets.list(provider="aws", risk="high", limit=50)
for a in assets.data:
    print(a.name, a.algorithm, a.risk_level)

# Or stream every asset
for a in pq.assets.iter_all(environment="production"):
    ...

# Browse keys discovered by cloud scans
keys = pq.keys.list(algorithm="RSA", quantum_vulnerable=True)
for k in keys.data:
    print(k.provider, k.region, k.key_id, k.algorithm)

## Configuration

| Argument      | Default                  | Notes                                  |
| ------------- | ------------------------ | -------------------------------------- |
| `api_key`     | `$POSTQ_API_KEY`         | `pq_live_…` from your dashboard        |
| `base_url`    | `https://api.postq.dev`  | Override for staging or self-hosted    |
| `timeout`     | `30.0`                   | Per-request timeout in seconds         |
| `max_retries` | `3`                      | Retries on 429/5xx with backoff        |

## Errors

All exceptions extend `PostQError`:

```python
from postq import PostQ, PostQAuthError, PostQRateLimitError

try:
    pq.scans.list()
except PostQAuthError:
    print("bad API key")
except PostQRateLimitError:
    print("slow down")
Exception When
PostQConfigError Missing/invalid constructor input
PostQAuthError 401 — bad, revoked, or expired key
PostQNotFoundError 404
PostQRateLimitError 429
PostQServerError 5xx
PostQNetworkError DNS, connection refused, timeout
PostQError Base class

Requirements

  • Python 3.9+
  • Single dependency: requests

License

MIT — see LICENSE.

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

postq_sdk-0.4.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

postq_sdk-0.4.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file postq_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: postq_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for postq_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 02b4aa9d9583b0717c92bb35999852b884b979260563477e97fdf176bb29325a
MD5 fc962c970447dee4ee5a56f3ad3f8d6e
BLAKE2b-256 570aef4b3cabc2264db02ef4cb07f84b1f817635aa0667021963b3f076384ff3

See more details on using hashes here.

Provenance

The following attestation bundles were made for postq_sdk-0.4.0.tar.gz:

Publisher: publish-pypi.yml on PostQDev/postq-sdk-all

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file postq_sdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: postq_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for postq_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e44aa45a3ff16887f7368dccc35d1daa9bed0699822509bf7f263fe9843e528
MD5 81529fd7f5d7ebc2f10a9c7bd8fcc2db
BLAKE2b-256 304275220f89d27e5e3ea436482c2fa5230d8d3b4a67335c0950230c3206b22f

See more details on using hashes here.

Provenance

The following attestation bundles were made for postq_sdk-0.4.0-py3-none-any.whl:

Publisher: publish-pypi.yml on PostQDev/postq-sdk-all

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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