walacor-python-sdk 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- walacor_python_sdk-0.1.2/PKG-INFO +191 -0
- walacor_python_sdk-0.1.2/README.md +163 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/pyproject.toml +9 -0
- walacor_python_sdk-0.1.2/src/walacor_python_sdk.egg-info/PKG-INFO +191 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_python_sdk.egg-info/SOURCES.txt +1 -1
- walacor_python_sdk-0.1.2/src/walacor_sdk/__init__.py +26 -0
- walacor_python_sdk-0.1.2/src/walacor_sdk/data_requests/__init__.py +49 -0
- walacor_python_sdk-0.1.2/src/walacor_sdk/file_request/__init__.py +43 -0
- walacor_python_sdk-0.1.2/src/walacor_sdk/schema/__init__.py +49 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/tests/test_schema.py +144 -128
- walacor_python_sdk-0.1.1/PKG-INFO +0 -112
- walacor_python_sdk-0.1.1/README.md +0 -84
- walacor_python_sdk-0.1.1/src/walacor_python_sdk.egg-info/PKG-INFO +0 -112
- walacor_python_sdk-0.1.1/src/walacor_sdk/authentication/models/response.py +0 -5
- walacor_python_sdk-0.1.1/src/walacor_sdk/schema/__init__.py +0 -0
- walacor_python_sdk-0.1.1/src/walacor_sdk/schema/models/__init__.py +0 -0
- walacor_python_sdk-0.1.1/tests/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/.github/workflows/ci.yaml +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/.github/workflows/release.yaml +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/.gitignore +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/.pre-commit-config.yaml +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/CONTRIBUTING.md +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/LICENSE +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/setup.cfg +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_python_sdk.egg-info/dependency_links.txt +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_python_sdk.egg-info/requires.txt +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_python_sdk.egg-info/top_level.txt +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk → walacor_python_sdk-0.1.2/src/walacor_sdk/authentication}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/authentication/auth_service.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/authentication → walacor_python_sdk-0.1.2/src/walacor_sdk/authentication/models}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/authentication/models → walacor_python_sdk-0.1.2/src/walacor_sdk/base}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/base/base_service.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/base/facade.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/base → walacor_python_sdk-0.1.2/src/walacor_sdk/base/model}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/base/model/base_response_model.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/base/w_client.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/base/walacor_service.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/data_requests/data_requests_service.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/base/model → walacor_python_sdk-0.1.2/src/walacor_sdk/data_requests/models}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/data_requests/models/data_request_response.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/data_requests/models/data_requests_request.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/data_requests/models/models.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/file_request/file_request_service.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/data_requests → walacor_python_sdk-0.1.2/src/walacor_sdk/file_request/models}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/file_request/models/file_request_request.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/file_request/models/file_request_response.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/file_request/models/models.py +0 -0
- /walacor_python_sdk-0.1.1/src/walacor_sdk/data_requests/models/__init__.py → /walacor_python_sdk-0.1.2/src/walacor_sdk/py.typed +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/file_request → walacor_python_sdk-0.1.2/src/walacor_sdk/schema/models}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/schema/models/models.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/schema/models/schema_request.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/schema/models/schema_response.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/schema/schema_service.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/utils/__init__ +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/utils/enums.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/utils/exceptions.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/utils/global_exception_handler.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_sdk/utils/logger.py +0 -0
- {walacor_python_sdk-0.1.1/src/walacor_sdk/file_request/models → walacor_python_sdk-0.1.2/tests}/__init__.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/tests/test_client.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/tests/test_data_requests.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/tests/test_facade.py +0 -0
- {walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/tests/test_file_request.py +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: walacor_python_sdk
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Python SDK for Walacor
|
|
5
|
+
Author-email: Garo Kechichian <garo.keshish@gmail.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Documentation, https://apidoc.walacor.com
|
|
8
|
+
Project-URL: Homepage, https://www.walacor.com
|
|
9
|
+
Keywords: data-transformations,lineage,provenance,walacor
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: requests>=2.32.3
|
|
21
|
+
Requires-Dist: pydantic>=2.10
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=6; extra == "test"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
26
|
+
Requires-Dist: tox; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Walacor Python SDK
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
|
|
33
|
+
<img src="https://www.walacor.com/wp-content/uploads/2022/09/Walacor_Logo_Tag.png" width="300" />
|
|
34
|
+
|
|
35
|
+
[![License Apache 2.0][badge-license]][license]
|
|
36
|
+
[](https://discord.gg/BaEWpsg8Yc)
|
|
37
|
+
[](https://www.linkedin.com/company/walacor/)
|
|
38
|
+
[](https://www.walacor.com/product/)
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
[badge-license]: https://img.shields.io/badge/license-Apache2-green.svg?dummy
|
|
43
|
+
[license]: https://github.com/walacor/objectvalidation/blob/main/LICENSE
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Walacor Python SDK
|
|
47
|
+
|
|
48
|
+
[](https://pypi.org/project/walacor-python-sdk/)
|
|
49
|
+
[](LICENSE)
|
|
50
|
+
|
|
51
|
+
*A typed, lightweight wrapper around Walacor’s REST API for immutable provenance, schema management and (soon) data‑science transformations.*
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ✨ Features
|
|
56
|
+
|
|
57
|
+
* **One‑liner setup** – a single `WalacorService` object bootstraps authentication and exposes sub‑clients (`auth`, `schema`, `data`, *etc.*)
|
|
58
|
+
* **Pydantic models everywhere** – rich typing, runtime validation and IDE autocompletion.
|
|
59
|
+
* **Version‑safe schemas** – helper methods to list, inspect and create schema blueprints.
|
|
60
|
+
* **Composable requests** – thin wrappers over `requests` that automatically inject Bearer tokens and headers.
|
|
61
|
+
* **Python 3.11 + only** – enjoy `typing` generics, `|` unions, `match` statements.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 📦 Installation
|
|
66
|
+
|
|
67
|
+
### From PyPI (recommended)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install walacor-python-sdk
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### From source (editable)
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/walacor/python-sdk.git
|
|
77
|
+
cd python-sdk
|
|
78
|
+
pip install -e .[dev,test]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> After installation, import via `walacor_sdk` (underscore), **not** the PyPI name with a dash.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from walacor_sdk import WalacorService
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🚀 Quick Start
|
|
90
|
+
|
|
91
|
+
### 1 – Create a service instance
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from walacor_sdk import WalacorService
|
|
95
|
+
|
|
96
|
+
wal = WalacorService(
|
|
97
|
+
server="http://[walacor.instance.address/api",
|
|
98
|
+
username="Admin",
|
|
99
|
+
password="Password!"
|
|
100
|
+
)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Need to change credentials later?
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
wal.changeCred("new_user", "new_password")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2 – Work with schemas
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from walacor_sdk.schema.models import (
|
|
113
|
+
CreateSchemaRequest, CreateSchemaDefinition,
|
|
114
|
+
CreateFieldRequest, CreateIndexRequest
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
schema_req = CreateSchemaRequest(
|
|
118
|
+
ETId=50, # system envelope for schemas
|
|
119
|
+
SV=1,
|
|
120
|
+
Schema=CreateSchemaDefinition(
|
|
121
|
+
ETId=654321,
|
|
122
|
+
TableName="books",
|
|
123
|
+
Family="library",
|
|
124
|
+
DoSummary=True,
|
|
125
|
+
Fields=[
|
|
126
|
+
CreateFieldRequest(FieldName="book_id", DataType="TEXT", Required=True),
|
|
127
|
+
CreateFieldRequest(FieldName="title", DataType="TEXT", Required=True)
|
|
128
|
+
],
|
|
129
|
+
Indexes=[
|
|
130
|
+
CreateIndexRequest(Fields=["book_id"], IndexValue="book_id")
|
|
131
|
+
]
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
meta = wal.schema.create_schema(schema_req)
|
|
136
|
+
print("Created schema envelope:", meta.EId)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Other handy calls:
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
# list latest versions for every ETId
|
|
143
|
+
for s in wal.schema.get_list_with_latest_version():
|
|
144
|
+
print(s.ETId, s.TableName)
|
|
145
|
+
|
|
146
|
+
# detailed info for a known ETId
|
|
147
|
+
info = wal.schema.get_schema_details_with_ETId(654321)
|
|
148
|
+
print(info.Fields)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 3 – Use enums & constants
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from walacor_sdk.utils.enums import SystemEnvelopeType
|
|
155
|
+
print(SystemEnvelopeType.SCHEMA.value) # -> 50
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## ⚙️ Error handling & logging
|
|
161
|
+
|
|
162
|
+
* Network errors raise `requests.HTTPError` so you can retry or surface gracefully.
|
|
163
|
+
* Validation errors are logged with `logging.error` and result in `None`/`[]` returns, never raw dictionaries.
|
|
164
|
+
* The SDK writes to the module‑level *walacor\_sdk.utils.logger* logger; attach your own handler or redirect to file.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 🧪 Running tests
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pip install .[test]
|
|
172
|
+
pytest -q
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 🤝 Contributing
|
|
178
|
+
|
|
179
|
+
We love PRs! Please open an issue first for large features. All contributions must:
|
|
180
|
+
|
|
181
|
+
* Pass `pre-commit` hooks (`pre-commit run --all-files`).
|
|
182
|
+
* Include unit tests with `pytest`.
|
|
183
|
+
* Follow the existing docstring & typing style.
|
|
184
|
+
|
|
185
|
+
For full contribution details, see 👉 [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 📄 License
|
|
190
|
+
|
|
191
|
+
Apache 2.0 © 2025 Walacor & Contributors.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Walacor Python SDK
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<img src="https://www.walacor.com/wp-content/uploads/2022/09/Walacor_Logo_Tag.png" width="300" />
|
|
6
|
+
|
|
7
|
+
[![License Apache 2.0][badge-license]][license]
|
|
8
|
+
[](https://discord.gg/BaEWpsg8Yc)
|
|
9
|
+
[](https://www.linkedin.com/company/walacor/)
|
|
10
|
+
[](https://www.walacor.com/product/)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
[badge-license]: https://img.shields.io/badge/license-Apache2-green.svg?dummy
|
|
15
|
+
[license]: https://github.com/walacor/objectvalidation/blob/main/LICENSE
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Walacor Python SDK
|
|
19
|
+
|
|
20
|
+
[](https://pypi.org/project/walacor-python-sdk/)
|
|
21
|
+
[](LICENSE)
|
|
22
|
+
|
|
23
|
+
*A typed, lightweight wrapper around Walacor’s REST API for immutable provenance, schema management and (soon) data‑science transformations.*
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ✨ Features
|
|
28
|
+
|
|
29
|
+
* **One‑liner setup** – a single `WalacorService` object bootstraps authentication and exposes sub‑clients (`auth`, `schema`, `data`, *etc.*)
|
|
30
|
+
* **Pydantic models everywhere** – rich typing, runtime validation and IDE autocompletion.
|
|
31
|
+
* **Version‑safe schemas** – helper methods to list, inspect and create schema blueprints.
|
|
32
|
+
* **Composable requests** – thin wrappers over `requests` that automatically inject Bearer tokens and headers.
|
|
33
|
+
* **Python 3.11 + only** – enjoy `typing` generics, `|` unions, `match` statements.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 📦 Installation
|
|
38
|
+
|
|
39
|
+
### From PyPI (recommended)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install walacor-python-sdk
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### From source (editable)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/walacor/python-sdk.git
|
|
49
|
+
cd python-sdk
|
|
50
|
+
pip install -e .[dev,test]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> After installation, import via `walacor_sdk` (underscore), **not** the PyPI name with a dash.
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from walacor_sdk import WalacorService
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🚀 Quick Start
|
|
62
|
+
|
|
63
|
+
### 1 – Create a service instance
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from walacor_sdk import WalacorService
|
|
67
|
+
|
|
68
|
+
wal = WalacorService(
|
|
69
|
+
server="http://[walacor.instance.address/api",
|
|
70
|
+
username="Admin",
|
|
71
|
+
password="Password!"
|
|
72
|
+
)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Need to change credentials later?
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
wal.changeCred("new_user", "new_password")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2 – Work with schemas
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from walacor_sdk.schema.models import (
|
|
85
|
+
CreateSchemaRequest, CreateSchemaDefinition,
|
|
86
|
+
CreateFieldRequest, CreateIndexRequest
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
schema_req = CreateSchemaRequest(
|
|
90
|
+
ETId=50, # system envelope for schemas
|
|
91
|
+
SV=1,
|
|
92
|
+
Schema=CreateSchemaDefinition(
|
|
93
|
+
ETId=654321,
|
|
94
|
+
TableName="books",
|
|
95
|
+
Family="library",
|
|
96
|
+
DoSummary=True,
|
|
97
|
+
Fields=[
|
|
98
|
+
CreateFieldRequest(FieldName="book_id", DataType="TEXT", Required=True),
|
|
99
|
+
CreateFieldRequest(FieldName="title", DataType="TEXT", Required=True)
|
|
100
|
+
],
|
|
101
|
+
Indexes=[
|
|
102
|
+
CreateIndexRequest(Fields=["book_id"], IndexValue="book_id")
|
|
103
|
+
]
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
meta = wal.schema.create_schema(schema_req)
|
|
108
|
+
print("Created schema envelope:", meta.EId)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Other handy calls:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# list latest versions for every ETId
|
|
115
|
+
for s in wal.schema.get_list_with_latest_version():
|
|
116
|
+
print(s.ETId, s.TableName)
|
|
117
|
+
|
|
118
|
+
# detailed info for a known ETId
|
|
119
|
+
info = wal.schema.get_schema_details_with_ETId(654321)
|
|
120
|
+
print(info.Fields)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 3 – Use enums & constants
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
from walacor_sdk.utils.enums import SystemEnvelopeType
|
|
127
|
+
print(SystemEnvelopeType.SCHEMA.value) # -> 50
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## ⚙️ Error handling & logging
|
|
133
|
+
|
|
134
|
+
* Network errors raise `requests.HTTPError` so you can retry or surface gracefully.
|
|
135
|
+
* Validation errors are logged with `logging.error` and result in `None`/`[]` returns, never raw dictionaries.
|
|
136
|
+
* The SDK writes to the module‑level *walacor\_sdk.utils.logger* logger; attach your own handler or redirect to file.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 🧪 Running tests
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pip install .[test]
|
|
144
|
+
pytest -q
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🤝 Contributing
|
|
150
|
+
|
|
151
|
+
We love PRs! Please open an issue first for large features. All contributions must:
|
|
152
|
+
|
|
153
|
+
* Pass `pre-commit` hooks (`pre-commit run --all-files`).
|
|
154
|
+
* Include unit tests with `pytest`.
|
|
155
|
+
* Follow the existing docstring & typing style.
|
|
156
|
+
|
|
157
|
+
For full contribution details, see 👉 [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 📄 License
|
|
162
|
+
|
|
163
|
+
Apache 2.0 © 2025 Walacor & Contributors.
|
|
@@ -52,6 +52,15 @@ dev = [
|
|
|
52
52
|
Documentation = "https://apidoc.walacor.com"
|
|
53
53
|
Homepage = "https://www.walacor.com"
|
|
54
54
|
|
|
55
|
+
[tool.setuptools.package-data]
|
|
56
|
+
"walacor_sdk" = ["py.typed"]
|
|
57
|
+
|
|
58
|
+
[tool.setuptools]
|
|
59
|
+
package-dir = {"" = "src"}
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["src"]
|
|
63
|
+
|
|
55
64
|
[tool.ruff]
|
|
56
65
|
src = [ "src" ]
|
|
57
66
|
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: walacor_python_sdk
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Python SDK for Walacor
|
|
5
|
+
Author-email: Garo Kechichian <garo.keshish@gmail.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Documentation, https://apidoc.walacor.com
|
|
8
|
+
Project-URL: Homepage, https://www.walacor.com
|
|
9
|
+
Keywords: data-transformations,lineage,provenance,walacor
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: requests>=2.32.3
|
|
21
|
+
Requires-Dist: pydantic>=2.10
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=6; extra == "test"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
26
|
+
Requires-Dist: tox; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Walacor Python SDK
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
|
|
33
|
+
<img src="https://www.walacor.com/wp-content/uploads/2022/09/Walacor_Logo_Tag.png" width="300" />
|
|
34
|
+
|
|
35
|
+
[![License Apache 2.0][badge-license]][license]
|
|
36
|
+
[](https://discord.gg/BaEWpsg8Yc)
|
|
37
|
+
[](https://www.linkedin.com/company/walacor/)
|
|
38
|
+
[](https://www.walacor.com/product/)
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
[badge-license]: https://img.shields.io/badge/license-Apache2-green.svg?dummy
|
|
43
|
+
[license]: https://github.com/walacor/objectvalidation/blob/main/LICENSE
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Walacor Python SDK
|
|
47
|
+
|
|
48
|
+
[](https://pypi.org/project/walacor-python-sdk/)
|
|
49
|
+
[](LICENSE)
|
|
50
|
+
|
|
51
|
+
*A typed, lightweight wrapper around Walacor’s REST API for immutable provenance, schema management and (soon) data‑science transformations.*
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ✨ Features
|
|
56
|
+
|
|
57
|
+
* **One‑liner setup** – a single `WalacorService` object bootstraps authentication and exposes sub‑clients (`auth`, `schema`, `data`, *etc.*)
|
|
58
|
+
* **Pydantic models everywhere** – rich typing, runtime validation and IDE autocompletion.
|
|
59
|
+
* **Version‑safe schemas** – helper methods to list, inspect and create schema blueprints.
|
|
60
|
+
* **Composable requests** – thin wrappers over `requests` that automatically inject Bearer tokens and headers.
|
|
61
|
+
* **Python 3.11 + only** – enjoy `typing` generics, `|` unions, `match` statements.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 📦 Installation
|
|
66
|
+
|
|
67
|
+
### From PyPI (recommended)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install walacor-python-sdk
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### From source (editable)
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/walacor/python-sdk.git
|
|
77
|
+
cd python-sdk
|
|
78
|
+
pip install -e .[dev,test]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> After installation, import via `walacor_sdk` (underscore), **not** the PyPI name with a dash.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from walacor_sdk import WalacorService
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🚀 Quick Start
|
|
90
|
+
|
|
91
|
+
### 1 – Create a service instance
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from walacor_sdk import WalacorService
|
|
95
|
+
|
|
96
|
+
wal = WalacorService(
|
|
97
|
+
server="http://[walacor.instance.address/api",
|
|
98
|
+
username="Admin",
|
|
99
|
+
password="Password!"
|
|
100
|
+
)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Need to change credentials later?
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
wal.changeCred("new_user", "new_password")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2 – Work with schemas
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from walacor_sdk.schema.models import (
|
|
113
|
+
CreateSchemaRequest, CreateSchemaDefinition,
|
|
114
|
+
CreateFieldRequest, CreateIndexRequest
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
schema_req = CreateSchemaRequest(
|
|
118
|
+
ETId=50, # system envelope for schemas
|
|
119
|
+
SV=1,
|
|
120
|
+
Schema=CreateSchemaDefinition(
|
|
121
|
+
ETId=654321,
|
|
122
|
+
TableName="books",
|
|
123
|
+
Family="library",
|
|
124
|
+
DoSummary=True,
|
|
125
|
+
Fields=[
|
|
126
|
+
CreateFieldRequest(FieldName="book_id", DataType="TEXT", Required=True),
|
|
127
|
+
CreateFieldRequest(FieldName="title", DataType="TEXT", Required=True)
|
|
128
|
+
],
|
|
129
|
+
Indexes=[
|
|
130
|
+
CreateIndexRequest(Fields=["book_id"], IndexValue="book_id")
|
|
131
|
+
]
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
meta = wal.schema.create_schema(schema_req)
|
|
136
|
+
print("Created schema envelope:", meta.EId)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Other handy calls:
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
# list latest versions for every ETId
|
|
143
|
+
for s in wal.schema.get_list_with_latest_version():
|
|
144
|
+
print(s.ETId, s.TableName)
|
|
145
|
+
|
|
146
|
+
# detailed info for a known ETId
|
|
147
|
+
info = wal.schema.get_schema_details_with_ETId(654321)
|
|
148
|
+
print(info.Fields)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 3 – Use enums & constants
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from walacor_sdk.utils.enums import SystemEnvelopeType
|
|
155
|
+
print(SystemEnvelopeType.SCHEMA.value) # -> 50
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## ⚙️ Error handling & logging
|
|
161
|
+
|
|
162
|
+
* Network errors raise `requests.HTTPError` so you can retry or surface gracefully.
|
|
163
|
+
* Validation errors are logged with `logging.error` and result in `None`/`[]` returns, never raw dictionaries.
|
|
164
|
+
* The SDK writes to the module‑level *walacor\_sdk.utils.logger* logger; attach your own handler or redirect to file.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 🧪 Running tests
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pip install .[test]
|
|
172
|
+
pytest -q
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 🤝 Contributing
|
|
178
|
+
|
|
179
|
+
We love PRs! Please open an issue first for large features. All contributions must:
|
|
180
|
+
|
|
181
|
+
* Pass `pre-commit` hooks (`pre-commit run --all-files`).
|
|
182
|
+
* Include unit tests with `pytest`.
|
|
183
|
+
* Follow the existing docstring & typing style.
|
|
184
|
+
|
|
185
|
+
For full contribution details, see 👉 [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 📄 License
|
|
190
|
+
|
|
191
|
+
Apache 2.0 © 2025 Walacor & Contributors.
|
{walacor_python_sdk-0.1.1 → walacor_python_sdk-0.1.2}/src/walacor_python_sdk.egg-info/SOURCES.txt
RENAMED
|
@@ -12,10 +12,10 @@ src/walacor_python_sdk.egg-info/dependency_links.txt
|
|
|
12
12
|
src/walacor_python_sdk.egg-info/requires.txt
|
|
13
13
|
src/walacor_python_sdk.egg-info/top_level.txt
|
|
14
14
|
src/walacor_sdk/__init__.py
|
|
15
|
+
src/walacor_sdk/py.typed
|
|
15
16
|
src/walacor_sdk/authentication/__init__.py
|
|
16
17
|
src/walacor_sdk/authentication/auth_service.py
|
|
17
18
|
src/walacor_sdk/authentication/models/__init__.py
|
|
18
|
-
src/walacor_sdk/authentication/models/response.py
|
|
19
19
|
src/walacor_sdk/base/__init__.py
|
|
20
20
|
src/walacor_sdk/base/base_service.py
|
|
21
21
|
src/walacor_sdk/base/facade.py
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import types
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from .base.walacor_service import WalacorService
|
|
7
|
+
|
|
8
|
+
__all__: list[str] = [
|
|
9
|
+
"WalacorService",
|
|
10
|
+
"authentication",
|
|
11
|
+
"schema",
|
|
12
|
+
"file_request",
|
|
13
|
+
"data_requests",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(name: str) -> types.ModuleType:
|
|
18
|
+
if name in __all__[2:]:
|
|
19
|
+
mod = import_module(f"{__name__}.{name}")
|
|
20
|
+
globals()[name] = mod
|
|
21
|
+
return mod
|
|
22
|
+
raise AttributeError(name)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING: # pragma: no cover
|
|
26
|
+
from . import authentication, data_requests, file_request, schema
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import types
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from .data_requests_service import DataRequestsService
|
|
7
|
+
from .models.data_request_response import (
|
|
8
|
+
GetAllRecordsResponse,
|
|
9
|
+
GetComplexQMLQueryResponse,
|
|
10
|
+
GetComplexQueryResponse,
|
|
11
|
+
GetSingleRecordResponse,
|
|
12
|
+
QueryApiAggregateResponse,
|
|
13
|
+
QueryApiResponse,
|
|
14
|
+
SingleDataRequestResponse,
|
|
15
|
+
)
|
|
16
|
+
from .models.models import (
|
|
17
|
+
ComplexQMLQueryRecords,
|
|
18
|
+
ComplexQueryRecords,
|
|
19
|
+
QueryApiAggregate,
|
|
20
|
+
SubmissionResult,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__all__: list[str] = [
|
|
24
|
+
"DataRequestsService",
|
|
25
|
+
"SingleDataRequestResponse",
|
|
26
|
+
"GetAllRecordsResponse",
|
|
27
|
+
"GetSingleRecordResponse",
|
|
28
|
+
"GetComplexQueryResponse",
|
|
29
|
+
"QueryApiResponse",
|
|
30
|
+
"QueryApiAggregateResponse",
|
|
31
|
+
"GetComplexQMLQueryResponse",
|
|
32
|
+
"SubmissionResult",
|
|
33
|
+
"ComplexQueryRecords",
|
|
34
|
+
"QueryApiAggregate",
|
|
35
|
+
"ComplexQMLQueryRecords",
|
|
36
|
+
"models",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __getattr__(name: str) -> types.ModuleType:
|
|
41
|
+
if name == "models":
|
|
42
|
+
mod = import_module(f"{__name__}.models")
|
|
43
|
+
globals()[name] = mod
|
|
44
|
+
return mod
|
|
45
|
+
raise AttributeError(name)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if TYPE_CHECKING: # pragma: no cover
|
|
49
|
+
from . import models
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import types
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from .file_request_service import FileRequestService
|
|
7
|
+
from .models.file_request_request import (
|
|
8
|
+
StoreFileRequest,
|
|
9
|
+
VerifySingleFileRequest,
|
|
10
|
+
)
|
|
11
|
+
from .models.file_request_response import (
|
|
12
|
+
ListFilesResponse,
|
|
13
|
+
StoreFileResponse,
|
|
14
|
+
VerifyResponse,
|
|
15
|
+
)
|
|
16
|
+
from .models.models import (
|
|
17
|
+
FileItem,
|
|
18
|
+
FileMetadata,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__: list[str] = [
|
|
22
|
+
"FileRequestService",
|
|
23
|
+
"VerifySingleFileRequest",
|
|
24
|
+
"StoreFileRequest",
|
|
25
|
+
"VerifyResponse",
|
|
26
|
+
"StoreFileResponse",
|
|
27
|
+
"ListFilesResponse",
|
|
28
|
+
"FileItem",
|
|
29
|
+
"FileMetadata",
|
|
30
|
+
"models",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __getattr__(name: str) -> types.ModuleType:
|
|
35
|
+
if name == "models":
|
|
36
|
+
mod = import_module(f"{__name__}.models")
|
|
37
|
+
globals()[name] = mod
|
|
38
|
+
return mod
|
|
39
|
+
raise AttributeError(name)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if TYPE_CHECKING: # pragma: no cover
|
|
43
|
+
from . import models
|