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():
    ...

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:

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.2.0.tar.gz (5.4 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.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: postq_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 f2ba964b07ddeaaff6f749996ec39d396628c33b9d3e81db8617e8c2f8a54c76
MD5 54144825c8719f6af452f25ecba31c5a
BLAKE2b-256 2504369301811256027ea6ec2c532453d4015e952426ac104b16523c31c2745c

See more details on using hashes here.

Provenance

The following attestation bundles were made for postq_sdk-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: postq_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94ecefb646fba05e1c7425cf643b176eb8db096ce63cb0f6a184d1c10ffe8e4e
MD5 110e9f4bd8459a675741cb7dae439f6d
BLAKE2b-256 12aab0335c069cbdd9cbb7f965fbd6dab6461d288d491dc57eb2635f3ec361e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for postq_sdk-0.2.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