Walacor Python SDK
Walacor Python SDK
A typed, lightweight wrapper around Walacor’s REST API for immutable provenance, schema management and (soon) data‑science transformations.
✨ Features
- One‑liner setup – a single
WalacorServiceobject bootstraps authentication and exposes sub‑clients (auth,schema,data, etc.) - Pydantic models everywhere – rich typing, runtime validation and IDE autocompletion.
- Version‑safe schemas – helper methods to list, inspect and create schema blueprints.
- Composable requests – thin wrappers over
requeststhat automatically inject Bearer tokens and headers. - Python 3.11 + only – enjoy
typinggenerics,|unions,matchstatements.
📦 Installation
From PyPI (recommended)
pip install walacor-python-sdk
From source (editable)
git clone https://github.com/walacor/python-sdk.git
cd python-sdk
pip install -e .[dev,test]
After installation, import via
walacor_sdk(underscore), not the PyPI name with a dash.
from walacor_sdk import WalacorService
🚀 Quick Start
1 – Create a service instance
from walacor_sdk import WalacorService
wal = WalacorService(
server="http://[walacor.instance.address/api",
username="Admin",
password="Password!"
)
Need to change credentials later?
wal.changeCred("new_user", "new_password")
2 – Work with schemas
from walacor_sdk.schema.models import (
CreateSchemaRequest, CreateSchemaDefinition,
CreateFieldRequest, CreateIndexRequest
)
schema_req = CreateSchemaRequest(
ETId=50, # system envelope for schemas
SV=1,
Schema=CreateSchemaDefinition(
ETId=654321,
TableName="books",
Family="library",
DoSummary=True,
Fields=[
CreateFieldRequest(FieldName="book_id", DataType="TEXT", Required=True),
CreateFieldRequest(FieldName="title", DataType="TEXT", Required=True)
],
Indexes=[
CreateIndexRequest(Fields=["book_id"], IndexValue="book_id")
]
)
)
meta = wal.schema.create_schema(schema_req)
print("Created schema envelope:", meta.EId)
Other handy calls:
# list latest versions for every ETId
for s in wal.schema.get_list_with_latest_version():
print(s.ETId, s.TableName)
# detailed info for a known ETId
info = wal.schema.get_schema_details_with_ETId(654321)
print(info.Fields)
3 – Use enums & constants
from walacor_sdk.utils.enums import SystemEnvelopeType
print(SystemEnvelopeType.SCHEMA.value) # -> 50
⚙️ Error handling & logging
- Network errors raise
requests.HTTPErrorso you can retry or surface gracefully. - Validation errors are logged with
logging.errorand result inNone/[]returns, never raw dictionaries. - The SDK writes to the module‑level walacor_sdk.utils.logger logger; attach your own handler or redirect to file.
🧪 Running tests
pip install .[test]
pytest -q
🤝 Contributing
We love PRs! Please open an issue first for large features. All contributions must:
- Pass
pre-commithooks (pre-commit run --all-files). - Include unit tests with
pytest. - Follow the existing docstring & typing style.
For full contribution details, see 👉 CONTRIBUTING.md.
📄 License
Apache 2.0 © 2025 Walacor & Contributors.
Metadata
Release files for walacor-python-sdk 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| walacor_python_sdk-0.1.9.tar.gz | 37.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| walacor_python_sdk-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.4 kB
Release files / walacor_python_sdk-0.1.9.tar.gz
| Download URL | walacor_python_sdk-0.1.9.tar.gz |
|---|---|
| Size | 37.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3944bf3613f7e211b8fd64c67aaa948e98a02ad75345f290b45919017f151dd5
|
|
BLAKE2b-256 checksum How to use checksums |
2fced9ea137e8e0b0afc5e13ef88ccc0f3395f5c8a080c5ee188e9534cc0b672
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / walacor_python_sdk-0.1.9-py3-none-any.whl
| Download URL | walacor_python_sdk-0.1.9-py3-none-any.whl |
|---|---|
| Size | 34.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
060b8a2f5bfbff2df87aa542a80bfa1ea44f45274341f7cb9882f087089d26e5
|
|
BLAKE2b-256 checksum How to use checksums |
f15520175cd593b5500aa80b527ec19beeedc23d18f4d6a49491af57c480df9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency log