Python SDK for Nekuda payment processing
Project description
Quickstart
Welcome to the rapid-fire tour of the Nekuda Python SDK. In less than five minutes you will:
- install the package,
- authenticate with your API key, and
- run your first card-reveal workflow.
TL;DR – copy the snippets below into a file called
hello.py, export your API key, run it, done.
💡 Don't forget! This Python SDK handles the backend payment processing. You'll also need to integrate our wallet collection SDK on your frontend to securely collect credit card details from users.
1. Installation
We recommend using UV (fast Rust-based pip replacement), but plain pip works just as well:
uv pip install nekuda
#-or-
pip install nekuda
The SDK ships as a single, pure-python wheel with zero heavy dependencies – install is ~1 s.
2. Authenticate
Grab your secret key from the Nekuda dashboard and export it as an environment variable:
export NEKUDA_API_KEY="sk_live_…" # required
# Optional – point the SDK to staging / localmock
export NEKUDA_BASE_URL="https://staging-api.nekuda.ai"
That's all the configuration you need for the quickstart.
3. Hello World
from nekuda import NekudaClient
client = NekudaClient.from_env()
print("🚀 Authenticated! Your account ID is:", client.api_key[:8] + "…")
python hello.py
If everything is set-up correctly you should see:
🚀 Authenticated! Your account ID is: sk_live_12…
4. End-to-end flow in <40 lines
The snippet below walks through the full payment flow using mock data:
from nekuda import MandateData, NekudaClient
client = NekudaClient.from_env()
user = client.user("user_123")
# 1) Describe what the user is about to purchase
mandate = MandateData(product="Premium Subscription", price=49.99, currency="USD", merchant="Nekuda Corp")
mandate_id = user.create_mandate(mandate)["mandate_id"]
# 2) Ask for a short-lived *reveal token*
token = user.request_card_reveal_token(mandate_id)["reveal_token"]
# 3) Exchange the token for the raw card details (one-time operation)
card = user.reveal_card_details(token)
print("💳 **** **** ****", card.card_number[-4:])
Run it and you should see the last four digits of the test card printed to stdout.
🔗 Complete Integration: Remember that in a real application, steps 1-2 happen on your backend (using this Python SDK), while the actual card collection happens on your frontend using our React wallet SDK.
What's next?
- 📚 Full Documentation – comprehensive guides, API reference, and integration examples
- Guides – dive into the Payment & Card Reveal Flow for a deeper explanation of each step
- Core Concepts – get familiar with
NekudaClient,UserContext, and our data models - API Reference – see every parameter & response in detail (auto-generated from docstrings)
Happy hacking! 🎉
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nekuda-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nekuda-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6f975c5e46067cb35c1f878cd214093c8e16c59e0d29d885e55c5670b75e087
|
|
| MD5 |
8d8d2eba7d9ca6e13883d5c530aa18af
|
|
| BLAKE2b-256 |
bc33cb9a015bbcbd1d9ad423cc63419f380f8a04bf7838554fcc92aaccf83f10
|
Provenance
The following attestation bundles were made for nekuda-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on nekuda-ai/nekuda-sdk-backend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nekuda-0.2.1-py3-none-any.whl -
Subject digest:
d6f975c5e46067cb35c1f878cd214093c8e16c59e0d29d885e55c5670b75e087 - Sigstore transparency entry: 219669210
- Sigstore integration time:
-
Permalink:
nekuda-ai/nekuda-sdk-backend@b63c702432b8c871c26e7eb1068df2378989e082 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nekuda-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b63c702432b8c871c26e7eb1068df2378989e082 -
Trigger Event:
push
-
Statement type: