Python SDK for Walacor
Project description
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.
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 Distribution
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 walacor_python_sdk-0.1.3.tar.gz.
File metadata
- Download URL: walacor_python_sdk-0.1.3.tar.gz
- Upload date:
- Size: 35.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bc66886424586935b28d7426438e5089f3adf5ea6fd6cc267f6b0ce0dfbce4e
|
|
| MD5 |
13ba26a97d95a4598911f46df908bd79
|
|
| BLAKE2b-256 |
c2e5609c1eee9f5d5c20da85674c32cf00c88b0489018c16c99b3e99777bdb05
|
Provenance
The following attestation bundles were made for walacor_python_sdk-0.1.3.tar.gz:
Publisher:
release.yaml on walacor/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
walacor_python_sdk-0.1.3.tar.gz -
Subject digest:
0bc66886424586935b28d7426438e5089f3adf5ea6fd6cc267f6b0ce0dfbce4e - Sigstore transparency entry: 229756360
- Sigstore integration time:
-
Permalink:
walacor/python-sdk@2e79df786523ed158b3d4110a83c8f6c3e8a4cee -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/walacor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2e79df786523ed158b3d4110a83c8f6c3e8a4cee -
Trigger Event:
push
-
Statement type:
File details
Details for the file walacor_python_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: walacor_python_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 32.3 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 |
bef1f1d949986cfec7a5722dfa2829d41c4cb8cdbc6d8f5a909a5487870d0127
|
|
| MD5 |
31646fc6d8be668a6c8781c9d159bb7c
|
|
| BLAKE2b-256 |
bb3c8b0acb6fb7e30679e3e6dca1be2b7212a87c806e3ee25bf020f6d3952efa
|
Provenance
The following attestation bundles were made for walacor_python_sdk-0.1.3-py3-none-any.whl:
Publisher:
release.yaml on walacor/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
walacor_python_sdk-0.1.3-py3-none-any.whl -
Subject digest:
bef1f1d949986cfec7a5722dfa2829d41c4cb8cdbc6d8f5a909a5487870d0127 - Sigstore transparency entry: 229756363
- Sigstore integration time:
-
Permalink:
walacor/python-sdk@2e79df786523ed158b3d4110a83c8f6c3e8a4cee -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/walacor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2e79df786523ed158b3d4110a83c8f6c3e8a4cee -
Trigger Event:
push
-
Statement type: