NullPay Python SDK
nullpay-python is the Python equivalent of @nullpay/node.
It follows the same backend-first architecture:
- reads
nullpay.jsonlocally for named invoice lookup - calls the NullPay backend to create and retrieve checkout sessions
- uses the NullPay relayer flow for invoice pre-generation when
invoice_hashorsaltis missing - verifies webhook signatures locally with HMAC-SHA256
The smart-contract and Provable SDK work stays on the NullPay backend. This package is a thin Python client for FastAPI, Flask, Django, and plain Python services.
Install
pip install ./packages/nullpay-python
Basic usage
from nullpay import NullPay
client = NullPay({
"secretKey": "sk_test_...",
"baseURL": "https://nullpay-backend-ib5q4.ondigitalocean.app/api",
})
session = client.checkout.sessions.create({
"amount": 10,
"currency": "USDCX",
"type": "multipay",
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
})
print(session["checkout_url"])
API surface
NullPay(config)
Supported config keys:
secretKeyorsecret_keybaseURLorbase_urlprojectRootorproject_rootconfigPathorconfig_pathtimeout
load_nullpay_config(project_root=None, config_path=None)
Loads nullpay.json from the provided project root or explicit path.
client.invoices
get_all()get_by_index(i)get_by_name(name)get_by_type(type_name)
client.checkout.sessions
create(params)retrieve(session_id)
create(...) mirrors the Node SDK behavior:
- accepts
nullpay_invoice_nameandnullpay_invoice_index - auto-generates a salt if
invoice_hashorsaltis missing - calls
/dps/relayer/create-invoice - polls the Provable
salt_to_invoicemapping - performs best-effort dashboard sync via
/invoices - finally creates the hosted checkout session via
/checkout/sessions
client.webhooks
verify_signature(payload, signature)construct_event(payload, signature)
Framework examples
See examples/ for:
- FastAPI
- Flask
- Django
Tests
Run from this package directory:
python -m unittest discover -s tests
Metadata
Release files for nullpay-python 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 |
|---|---|---|---|---|
| nullpay_python-0.1.0.tar.gz | 7.0 kB | Without provenance | Details for nullpay_python-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nullpay_python-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nullpay_python-0.1.0-py3-none-any.whl |
Total release size: 14.0 kB
Release files / nullpay_python-0.1.0.tar.gz
| Download URL | nullpay_python-0.1.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22a77961c68369143520f300aae001c5cd7081eb3ebfbc9d3db7510e53bccdc4
|
|
BLAKE2b-256 checksum How to use checksums |
c0d55bccb3bf846dd93f5ca516b3e5ab8d56446296e87cbb70d972c6833df5b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / nullpay_python-0.1.0-py3-none-any.whl
| Download URL | nullpay_python-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afc8982d154e5abc3e80dd70df736998b92596edaf0bb9d3774a0d5f913144cf
|
|
BLAKE2b-256 checksum How to use checksums |
0c08376c1619cef72ff511ce5a40b79267177e0ae7cb512d296fcc0afcc8b8b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for nullpay-python 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.
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.