Smoke SDK for Python
Client for the Smoke public API v1 and helper to verify Smoke webhook signatures. Python 3.9 or later; standard library only.
pip install smoke-sdk
API
Create an integration token (Admins, after turning on API and webhooks in the workspace settings) or a personal token on the API tokens page. Keep it in a secret store, never in code.
import os
from smoke_sdk import SmokeClient
smoke = SmokeClient(os.environ["SMOKE_TOKEN"], "https://api.<your Smoke domain>/v1")
# Every P1 and P2 finding that still needs work, page by page.
for f in smoke.iter_findings(priority="P1,P2", status="open,in_progress"):
print(f["priority"], f["package"], f["version"], f["url"])
# Assign one to a member (user id from smoke.list_members()).
smoke.update_finding(finding_id, status="in_progress", assigneeId=user_id)
# Upload the inventory at every release, then wait for the result.
with open("package-lock.json", "rb") as fh:
snap = smoke.upload_inventory(
asset_id, [("package-lock.json", fh.read())], release="v1.4.2", commit=os.environ["GIT_SHA"]
)
done = smoke.wait_for_match(snap["id"])
if (done["findings"] or {}).get("unresolved", {}).get("p1", 0) > 0:
raise SystemExit(1)
Retries: 429, 5xx and network errors are retried up to 3 times with backoff, honouring
Retry-After; uploads send the same Idempotency-Key on every attempt. Errors are raised as
SmokeApiError with status, code (stable, see the API guide), details and request_id.
Webhooks
from smoke_sdk import verify_webhook_signature
# Flask: request.get_data() is the raw body.
@app.post("/smoke")
def smoke_webhook():
if not verify_webhook_signature(
request.get_data(), request.headers.get("X-Smoke-Signature"), os.environ["SMOKE_WEBHOOK_SECRET"]
):
return "", 401
event = request.get_json()
# Deduplicate by event["id"] (X-Smoke-Event-Id): a resent event keeps its id.
return "", 204
Versions
This SDK follows semver and targets API v1, which only changes additively. smoke_sdk/types.py
is generated from openapi.json (python3 tools/generate_types.py), a copy of the public API
document (https://api.<domain>/v1/openapi.json); a test checks they agree.
Source and releases
This repository is published at https://github.com/Aircraft-IT/smoke-sdk-python when a version
is released: each release is a tag v<version> on main, and pushing it runs
the publish workflow, which tests, builds and publishes the
package to PyPI through trusted publishing, with attestations. On pypi.org each file shows the
commit and workflow it was built from. Development happens in Smoke's own repository, so main
here moves only at releases.
Issues are welcome. Pull requests are not merged directly; a change we take is made in the development repository and appears here with the next release. Contributions are under the Apache License 2.0, like the rest of the repository.
License
Apache-2.0
Metadata
Release files for smoke-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smoke_sdk-0.1.0.tar.gz | 20.3 kB | With provenance | Details for smoke_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smoke_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for smoke_sdk-0.1.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / smoke_sdk-0.1.0.tar.gz
| Download URL | smoke_sdk-0.1.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
901558a1945aac24b8fecdeda2256f956a3acdda6f1556daaf98ef65996efee0
|
|
BLAKE2b-256 checksum How to use checksums |
fe08da648dd6c0a44dc4870048139e1202d633bf2b62eff57bcd9137a4006de0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / smoke_sdk-0.1.0-py3-none-any.whl
| Download URL | smoke_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efc72193fec8eb441cbf72ec27dd61c5a06e5574540466fa5730df67e671aab0
|
|
BLAKE2b-256 checksum How to use checksums |
f5201048da74b4f936be1423018f2949ee71cc5593711c12bac8870aaa5ac5d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for smoke-sdk 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for smoke_sdk-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA 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.