BeddrokClient
Python client for the Beddrok encryption API with automatic token management and robust error handling.
Installation
pip install BeddrokClient
Development
Dependencies are declared in pyproject.toml. For a local editable install with the dev tools (pytest, ruff, pyright):
pip install -e ".[dev]"
ruff check . && ruff format --check .
pyright
pytest
These are the same checks the PR workflow runs.
Quick Start
from beddrok_client import BeddrokClient
client = BeddrokClient(
user="username",
password="password",
api_url="https://api.beddrok.com"
)
# Encrypt/decrypt individual PINs
encrypted = client.encrypt_pins(["123456", "789012"])
decrypted = client.decrypt_pins(["enc_abc123", "enc_def456"])
# Validate PINs
validation = client.validate_pins(["123456", "789012"])
DataFrame Operations
Pandas
import pandas as pd
df = pd.DataFrame({
'id': [1, 2, 3],
'pin': ['123456', '789012', '345678']
})
# Encrypt
encrypted_df = client.encrypt_pandas_dataframe(df, 'pin', batch_size=100)
# Decrypt
decrypted_df = client.decrypt_pandas_dataframe(encrypted_df, 'pin', batch_size=100)
Polars
import polars as pl
df = pl.DataFrame({
'id': [1, 2, 3],
'pin': ['123456', '789012', '345678']
})
# Encrypt
encrypted_df = client.encrypt_polars_dataframe(df, 'pin', batch_size=100)
# Decrypt
decrypted_df = client.decrypt_polars_dataframe(encrypted_df, 'pin', batch_size=100)
Configuration
client = BeddrokClient(
user="username",
password="password",
api_url="https://api.beddrok.com",
refresh_token_after_x_minutes=5, # Token refresh buffer (default: 5)
timeout=30, # Request timeout (default: 30)
max_retries=3, # Retry attempts (default: 3)
backoff_base=2.0, # Exponential backoff (default: 2.0)
token_endpoint="auth/token", # Relative to api_url (default shown)
encrypt_endpoint="v2/encrypt",
decrypt_endpoint="v2/decrypt",
validate_endpoint="v2/validate",
)
Token Management
- Automatic token refresh before expiration
- Thread-safe token operations
- JWT payload parsing for expiration tracking
Network Resilience
- Exponential backoff retry:
backoff_base ^ (attempt + 1) - Handles 503 database errors
- Connection/timeout error recovery
License
GPL-3.0
Links
Metadata
Release files for BeddrokClient 2.0.3
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 | |
|---|---|---|---|---|
| beddrokclient-2.0.3.tar.gz | 5.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| beddrokclient-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / beddrokclient-2.0.3.tar.gz
| Download URL | beddrokclient-2.0.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7494d77f134a3eee0983f2dfdc0a4f24d0516b2790f570fe9706189fd2ac26d3
|
|
BLAKE2b-256 checksum How to use checksums |
ba3d8b6bdae68274c60470b4ede17d70d57f4a6010982fe900b95c4514b8fa03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 15, 2026.
Transparency logRelease files / beddrokclient-2.0.3-py3-none-any.whl
| Download URL | beddrokclient-2.0.3-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48e8459e30bd7d96e122c2a3abe5d98a4340519ba650855d0026b4541cdbfe37
|
|
BLAKE2b-256 checksum How to use checksums |
8d9c3575a483c0233a8b5a93dc3477028d1cc75f4b414053feeb10ffc453c684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 15, 2026.
Transparency logSecurity for BeddrokClient 2.0.3
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for beddrokclient-2.0.3.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 Oct 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.