ayva-ingest 0.1.0__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.
- ayva_ingest-0.1.0/LICENSE +21 -0
- ayva_ingest-0.1.0/PKG-INFO +86 -0
- ayva_ingest-0.1.0/README.md +59 -0
- ayva_ingest-0.1.0/ayva_ingest/__init__.py +92 -0
- ayva_ingest-0.1.0/ayva_ingest.egg-info/PKG-INFO +86 -0
- ayva_ingest-0.1.0/ayva_ingest.egg-info/SOURCES.txt +9 -0
- ayva_ingest-0.1.0/ayva_ingest.egg-info/dependency_links.txt +1 -0
- ayva_ingest-0.1.0/ayva_ingest.egg-info/requires.txt +3 -0
- ayva_ingest-0.1.0/ayva_ingest.egg-info/top_level.txt +1 -0
- ayva_ingest-0.1.0/pyproject.toml +41 -0
- ayva_ingest-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AYVA
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ayva-ingest
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Thin Python client for AYVA automated data sources
|
|
5
|
+
Author-email: AYVA <hello@ayva.tech>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://ayva.tech
|
|
8
|
+
Project-URL: Documentation, https://ayva-staging.onrender.com/ayva/data-workspace?tab=docs
|
|
9
|
+
Project-URL: Source, https://github.com/tossshix/ayva
|
|
10
|
+
Project-URL: Issues, https://github.com/tossshix/ayva/issues
|
|
11
|
+
Keywords: ayva,ingest,parquet,data-integration,etl
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pandas>=2.0
|
|
24
|
+
Requires-Dist: pyarrow>=14.0
|
|
25
|
+
Requires-Dist: requests>=2.28
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# ayva-ingest
|
|
29
|
+
|
|
30
|
+
Thin Python client for [AYVA](https://ayva.tech) automated data sources.
|
|
31
|
+
|
|
32
|
+
Upload a pandas DataFrame, CSV file, or Parquet file to the source bound to your
|
|
33
|
+
API key. The client normalizes to Snappy Parquet and enforces the 1 MiB canonical
|
|
34
|
+
limit before the request leaves your machine.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install ayva-ingest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import pandas as pd
|
|
46
|
+
from ayva_ingest import AyvaSource
|
|
47
|
+
|
|
48
|
+
source = AyvaSource(
|
|
49
|
+
api_key="ayva_live_…",
|
|
50
|
+
# Use your AYVA deployment origin (no trailing path).
|
|
51
|
+
base_url="https://ayva-staging.onrender.com",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
source.upload(
|
|
55
|
+
pd.DataFrame({"period": ["2026-Q1"], "revenue": [100]}),
|
|
56
|
+
idempotency_key="revenue-2026-q1",
|
|
57
|
+
)
|
|
58
|
+
source.upload("revenue.csv", idempotency_key="revenue-csv-2026-q2")
|
|
59
|
+
source.upload("revenue.parquet", idempotency_key="revenue-pq-2026-q3")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Create and rotate keys in **Report Library → Data Integration → Keys**.
|
|
63
|
+
|
|
64
|
+
## API contract (summary)
|
|
65
|
+
|
|
66
|
+
- `PUT {base_url}/api/v1/source/data`
|
|
67
|
+
- `Authorization: Bearer ayva_live_…`
|
|
68
|
+
- Required unique `Idempotency-Key`
|
|
69
|
+
- Body: canonical Parquet (`application/vnd.apache.parquet`)
|
|
70
|
+
|
|
71
|
+
## Publish (maintainers)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cd sdk/python
|
|
75
|
+
python -m pip install -U build twine
|
|
76
|
+
python -m build
|
|
77
|
+
python -m twine check dist/*
|
|
78
|
+
python -m twine upload dist/*
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use `__token__` as the username and a PyPI API token as the password.
|
|
82
|
+
Bump `version` in `pyproject.toml` for every release (PyPI versions are immutable).
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# ayva-ingest
|
|
2
|
+
|
|
3
|
+
Thin Python client for [AYVA](https://ayva.tech) automated data sources.
|
|
4
|
+
|
|
5
|
+
Upload a pandas DataFrame, CSV file, or Parquet file to the source bound to your
|
|
6
|
+
API key. The client normalizes to Snappy Parquet and enforces the 1 MiB canonical
|
|
7
|
+
limit before the request leaves your machine.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install ayva-ingest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import pandas as pd
|
|
19
|
+
from ayva_ingest import AyvaSource
|
|
20
|
+
|
|
21
|
+
source = AyvaSource(
|
|
22
|
+
api_key="ayva_live_…",
|
|
23
|
+
# Use your AYVA deployment origin (no trailing path).
|
|
24
|
+
base_url="https://ayva-staging.onrender.com",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
source.upload(
|
|
28
|
+
pd.DataFrame({"period": ["2026-Q1"], "revenue": [100]}),
|
|
29
|
+
idempotency_key="revenue-2026-q1",
|
|
30
|
+
)
|
|
31
|
+
source.upload("revenue.csv", idempotency_key="revenue-csv-2026-q2")
|
|
32
|
+
source.upload("revenue.parquet", idempotency_key="revenue-pq-2026-q3")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Create and rotate keys in **Report Library → Data Integration → Keys**.
|
|
36
|
+
|
|
37
|
+
## API contract (summary)
|
|
38
|
+
|
|
39
|
+
- `PUT {base_url}/api/v1/source/data`
|
|
40
|
+
- `Authorization: Bearer ayva_live_…`
|
|
41
|
+
- Required unique `Idempotency-Key`
|
|
42
|
+
- Body: canonical Parquet (`application/vnd.apache.parquet`)
|
|
43
|
+
|
|
44
|
+
## Publish (maintainers)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd sdk/python
|
|
48
|
+
python -m pip install -U build twine
|
|
49
|
+
python -m build
|
|
50
|
+
python -m twine check dist/*
|
|
51
|
+
python -m twine upload dist/*
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use `__token__` as the username and a PyPI API token as the password.
|
|
55
|
+
Bump `version` in `pyproject.toml` for every release (PyPI versions are immutable).
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Thin Python client for one AYVA automated data source."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import io
|
|
6
|
+
import uuid
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
import pandas as pd
|
|
11
|
+
import requests
|
|
12
|
+
|
|
13
|
+
__version__ = "0.1.0"
|
|
14
|
+
|
|
15
|
+
CANONICAL_LIMIT_BYTES = 1024 * 1024
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AyvaIngestError(RuntimeError):
|
|
19
|
+
"""Raised when local normalization or the AYVA API rejects an upload."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _as_dataframe(value: pd.DataFrame | str | Path) -> pd.DataFrame:
|
|
23
|
+
if isinstance(value, pd.DataFrame):
|
|
24
|
+
return value.copy()
|
|
25
|
+
path = Path(value)
|
|
26
|
+
suffix = path.suffix.lower()
|
|
27
|
+
if suffix == ".csv":
|
|
28
|
+
return pd.read_csv(path)
|
|
29
|
+
if suffix in {".parquet", ".pq"}:
|
|
30
|
+
return pd.read_parquet(path)
|
|
31
|
+
raise AyvaIngestError("Input must be a pandas DataFrame, .csv or .parquet path")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _canonical_bytes(value: pd.DataFrame | str | Path) -> bytes:
|
|
35
|
+
frame = _as_dataframe(value)
|
|
36
|
+
if frame.empty or len(frame.columns) == 0:
|
|
37
|
+
raise AyvaIngestError("Dataset is empty or has no columns")
|
|
38
|
+
columns = [str(column).strip() for column in frame.columns]
|
|
39
|
+
if any(not column for column in columns) or len(set(columns)) != len(columns):
|
|
40
|
+
raise AyvaIngestError("Column names must be non-empty and unique")
|
|
41
|
+
frame.columns = columns
|
|
42
|
+
output = io.BytesIO()
|
|
43
|
+
frame.to_parquet(output, index=False, engine="pyarrow", compression="snappy")
|
|
44
|
+
payload = output.getvalue()
|
|
45
|
+
if len(payload) > CANONICAL_LIMIT_BYTES:
|
|
46
|
+
raise AyvaIngestError(
|
|
47
|
+
f"Canonical Parquet is {len(payload)} bytes; limit is {CANONICAL_LIMIT_BYTES}"
|
|
48
|
+
)
|
|
49
|
+
return payload
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AyvaSource:
|
|
53
|
+
"""Client bound to the source represented by one AYVA API key."""
|
|
54
|
+
|
|
55
|
+
def __init__(
|
|
56
|
+
self,
|
|
57
|
+
api_key: str,
|
|
58
|
+
*,
|
|
59
|
+
base_url: str = "https://ayva-staging.onrender.com",
|
|
60
|
+
timeout: float = 30.0,
|
|
61
|
+
) -> None:
|
|
62
|
+
self.api_key = api_key
|
|
63
|
+
self.base_url = base_url.rstrip("/")
|
|
64
|
+
self.timeout = timeout
|
|
65
|
+
|
|
66
|
+
def upload(
|
|
67
|
+
self,
|
|
68
|
+
value: pd.DataFrame | str | Path,
|
|
69
|
+
*,
|
|
70
|
+
idempotency_key: str | None = None,
|
|
71
|
+
) -> dict[str, Any]:
|
|
72
|
+
payload = _canonical_bytes(value)
|
|
73
|
+
response = requests.put(
|
|
74
|
+
f"{self.base_url}/api/v1/source/data",
|
|
75
|
+
data=payload,
|
|
76
|
+
headers={
|
|
77
|
+
"Authorization": f"Bearer {self.api_key}",
|
|
78
|
+
"Idempotency-Key": idempotency_key or uuid.uuid4().hex,
|
|
79
|
+
"Content-Type": "application/vnd.apache.parquet",
|
|
80
|
+
},
|
|
81
|
+
timeout=self.timeout,
|
|
82
|
+
)
|
|
83
|
+
if not response.ok:
|
|
84
|
+
try:
|
|
85
|
+
detail = response.json()
|
|
86
|
+
except ValueError:
|
|
87
|
+
detail = response.text
|
|
88
|
+
raise AyvaIngestError(f"AYVA rejected upload ({response.status_code}): {detail}")
|
|
89
|
+
return response.json()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
__all__ = ["AyvaIngestError", "AyvaSource", "CANONICAL_LIMIT_BYTES", "__version__"]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ayva-ingest
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Thin Python client for AYVA automated data sources
|
|
5
|
+
Author-email: AYVA <hello@ayva.tech>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://ayva.tech
|
|
8
|
+
Project-URL: Documentation, https://ayva-staging.onrender.com/ayva/data-workspace?tab=docs
|
|
9
|
+
Project-URL: Source, https://github.com/tossshix/ayva
|
|
10
|
+
Project-URL: Issues, https://github.com/tossshix/ayva/issues
|
|
11
|
+
Keywords: ayva,ingest,parquet,data-integration,etl
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pandas>=2.0
|
|
24
|
+
Requires-Dist: pyarrow>=14.0
|
|
25
|
+
Requires-Dist: requests>=2.28
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# ayva-ingest
|
|
29
|
+
|
|
30
|
+
Thin Python client for [AYVA](https://ayva.tech) automated data sources.
|
|
31
|
+
|
|
32
|
+
Upload a pandas DataFrame, CSV file, or Parquet file to the source bound to your
|
|
33
|
+
API key. The client normalizes to Snappy Parquet and enforces the 1 MiB canonical
|
|
34
|
+
limit before the request leaves your machine.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install ayva-ingest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import pandas as pd
|
|
46
|
+
from ayva_ingest import AyvaSource
|
|
47
|
+
|
|
48
|
+
source = AyvaSource(
|
|
49
|
+
api_key="ayva_live_…",
|
|
50
|
+
# Use your AYVA deployment origin (no trailing path).
|
|
51
|
+
base_url="https://ayva-staging.onrender.com",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
source.upload(
|
|
55
|
+
pd.DataFrame({"period": ["2026-Q1"], "revenue": [100]}),
|
|
56
|
+
idempotency_key="revenue-2026-q1",
|
|
57
|
+
)
|
|
58
|
+
source.upload("revenue.csv", idempotency_key="revenue-csv-2026-q2")
|
|
59
|
+
source.upload("revenue.parquet", idempotency_key="revenue-pq-2026-q3")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Create and rotate keys in **Report Library → Data Integration → Keys**.
|
|
63
|
+
|
|
64
|
+
## API contract (summary)
|
|
65
|
+
|
|
66
|
+
- `PUT {base_url}/api/v1/source/data`
|
|
67
|
+
- `Authorization: Bearer ayva_live_…`
|
|
68
|
+
- Required unique `Idempotency-Key`
|
|
69
|
+
- Body: canonical Parquet (`application/vnd.apache.parquet`)
|
|
70
|
+
|
|
71
|
+
## Publish (maintainers)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cd sdk/python
|
|
75
|
+
python -m pip install -U build twine
|
|
76
|
+
python -m build
|
|
77
|
+
python -m twine check dist/*
|
|
78
|
+
python -m twine upload dist/*
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use `__token__` as the username and a PyPI API token as the password.
|
|
82
|
+
Bump `version` in `pyproject.toml` for every release (PyPI versions are immutable).
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ayva_ingest
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ayva-ingest"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Thin Python client for AYVA automated data sources"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "AYVA", email = "hello@ayva.tech" },
|
|
15
|
+
]
|
|
16
|
+
keywords = ["ayva", "ingest", "parquet", "data-integration", "etl"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 4 - Beta",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"pandas>=2.0",
|
|
29
|
+
"pyarrow>=14.0",
|
|
30
|
+
"requests>=2.28",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://ayva.tech"
|
|
35
|
+
Documentation = "https://ayva-staging.onrender.com/ayva/data-workspace?tab=docs"
|
|
36
|
+
Source = "https://github.com/tossshix/ayva"
|
|
37
|
+
Issues = "https://github.com/tossshix/ayva/issues"
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.packages.find]
|
|
40
|
+
where = ["."]
|
|
41
|
+
include = ["ayva_ingest*"]
|