periplus-python-sdk 0.7.0__tar.gz → 0.9.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.
Files changed (33) hide show
  1. periplus_python_sdk-0.9.0/PKG-INFO +83 -0
  2. periplus_python_sdk-0.9.0/README.md +63 -0
  3. periplus_python_sdk-0.9.0/licensing/LICENSE +661 -0
  4. periplus_python_sdk-0.9.0/licensing/NOTICE +4 -0
  5. periplus_python_sdk-0.9.0/licensing/README.md +42 -0
  6. periplus_python_sdk-0.9.0/licensing/THIRD_PARTY_NOTICES.md +192 -0
  7. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/pyproject.toml +3 -3
  8. periplus_python_sdk-0.9.0/src/periplus_python_sdk.egg-info/PKG-INFO +83 -0
  9. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_python_sdk.egg-info/SOURCES.txt +4 -2
  10. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/client.py +39 -32
  11. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/dbapi.py +44 -51
  12. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/sql_api.py +5 -4
  13. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/sqlalchemy.py +47 -33
  14. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/stream.py +1 -1
  15. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/types.py +7 -2
  16. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/tests/test_client.py +58 -35
  17. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/tests/test_dbapi.py +18 -7
  18. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/tests/test_notebook.py +55 -23
  19. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/tests/test_sql_api.py +19 -7
  20. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/tests/test_stream.py +11 -0
  21. periplus_python_sdk-0.7.0/LICENSE +0 -202
  22. periplus_python_sdk-0.7.0/NOTICE +0 -2
  23. periplus_python_sdk-0.7.0/PKG-INFO +0 -301
  24. periplus_python_sdk-0.7.0/README.md +0 -283
  25. periplus_python_sdk-0.7.0/src/periplus_python_sdk.egg-info/PKG-INFO +0 -301
  26. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/setup.cfg +0 -0
  27. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_python_sdk.egg-info/dependency_links.txt +0 -0
  28. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_python_sdk.egg-info/entry_points.txt +0 -0
  29. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_python_sdk.egg-info/requires.txt +0 -0
  30. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_python_sdk.egg-info/top_level.txt +0 -0
  31. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/__init__.py +0 -0
  32. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/errors.py +0 -0
  33. {periplus_python_sdk-0.7.0 → periplus_python_sdk-0.9.0}/src/periplus_sdk/py.typed +0 -0
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: periplus-python-sdk
3
+ Version: 0.9.0
4
+ Summary: Read-only Python client for the public Periplus query API
5
+ License-Expression: AGPL-3.0-only
6
+ Project-URL: Repository, https://github.com/elei-io/periplus
7
+ Project-URL: Issues, https://github.com/elei-io/periplus/issues
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: licensing/LICENSE
11
+ License-File: licensing/NOTICE
12
+ License-File: licensing/README.md
13
+ License-File: licensing/THIRD_PARTY_NOTICES.md
14
+ Requires-Dist: httpx>=0.28
15
+ Requires-Dist: pydantic<3,>=2.12
16
+ Requires-Dist: sqlalchemy<3,>=2.0
17
+ Provides-Extra: notebook
18
+ Requires-Dist: marimo[sql]>=0.24.1; extra == "notebook"
19
+ Dynamic: license-file
20
+
21
+ # Periplus Python SDK
22
+
23
+ SQL access to the ClickHouse corpus through the Periplus HTTP API.
24
+ Install from PyPI:
25
+
26
+ ```sh
27
+ python -m pip install --upgrade periplus-python-sdk
28
+ ```
29
+
30
+ ```python
31
+ from periplus_sdk import Client
32
+
33
+ with Client("https://api.periplus.dev", api_key="ppl_…") as client:
34
+ result = client.execute(
35
+ "SELECT capture_id, url FROM public_v1.captures LIMIT ?", [10]
36
+ )
37
+ print(result.columns, result.rows)
38
+ ```
39
+
40
+ Use `PERIPLUS_API_URL` to omit the URL argument and `PERIPLUS_API_KEY` to
41
+ supply your personal organization API key. A key with `organization:sql:exec`
42
+ is required. Database usernames/passwords and anonymous access are not supported.
43
+ Use HTTPS outside loopback development. Connect directly to the API origin,
44
+ not the public marketing site.
45
+
46
+ Version 0.9.0 requires personal API keys instead of database credentials. Create
47
+ a key in the app's Settings → API keys with `organization:sql:exec` permission.
48
+ For local development, install `./clients/periplus-python-sdk` from the repository
49
+ root and connect to `http://localhost:8000`.
50
+
51
+ `AsyncClient` accepts the same options. `prepare` explains a SELECT; `execute`
52
+ returns typed columns/rows for read-only queries. `schema()` returns
53
+ visible tables, column types/descriptions and helper documentation. All SQL uses
54
+ `POST /api/v1/sql`; schema discovery uses `GET /api/v1/schema`. ClickHouse enforces
55
+ permissions. The SDK never retries automatically, including failed queries.
56
+
57
+ Public HTML joins use `parse_id` and `node_index`; `document_id` identifies exact
58
+ raw bytes. Public shorthand uses the `public_v1` schema.
59
+
60
+ For notebook/SQLAlchemy integration:
61
+
62
+ ```python
63
+ from periplus_sdk import sql_api
64
+ from sqlalchemy import text
65
+
66
+ engine = sql_api.create_engine(base_url="http://localhost:8000", api_key="ppl_…")
67
+ with engine.connect() as connection:
68
+ print(connection.execute(text("SELECT url FROM public_v1.captures LIMIT 5")).all())
69
+ engine.dispose()
70
+ ```
71
+
72
+ Marimo discovers accessible tables and views through the schema endpoint. Column
73
+ reflection uses `SELECT * ... LIMIT 0` to retrieve native types without reading
74
+ corpus rows; no `SHOW`, `DESCRIBE`, or system-table access is required.
75
+
76
+ The DB-API connection advertises the ClickHouse dialect and converts native
77
+ nullable integer, decimal, date and datetime types. Nested types retain JSON wire
78
+ values. Writes are not exposed through the query API. There are no client
79
+ transactions; each statement is independent.
80
+ Streaming cursors expose incomplete/truncated results explicitly; configure
81
+ `allow_partial` only when partial results suit the application.
82
+
83
+ See [the public schema](../../docs/SCHEMA.md) and [query boundary](../../docs/QUERY.md).
@@ -0,0 +1,63 @@
1
+ # Periplus Python SDK
2
+
3
+ SQL access to the ClickHouse corpus through the Periplus HTTP API.
4
+ Install from PyPI:
5
+
6
+ ```sh
7
+ python -m pip install --upgrade periplus-python-sdk
8
+ ```
9
+
10
+ ```python
11
+ from periplus_sdk import Client
12
+
13
+ with Client("https://api.periplus.dev", api_key="ppl_…") as client:
14
+ result = client.execute(
15
+ "SELECT capture_id, url FROM public_v1.captures LIMIT ?", [10]
16
+ )
17
+ print(result.columns, result.rows)
18
+ ```
19
+
20
+ Use `PERIPLUS_API_URL` to omit the URL argument and `PERIPLUS_API_KEY` to
21
+ supply your personal organization API key. A key with `organization:sql:exec`
22
+ is required. Database usernames/passwords and anonymous access are not supported.
23
+ Use HTTPS outside loopback development. Connect directly to the API origin,
24
+ not the public marketing site.
25
+
26
+ Version 0.9.0 requires personal API keys instead of database credentials. Create
27
+ a key in the app's Settings → API keys with `organization:sql:exec` permission.
28
+ For local development, install `./clients/periplus-python-sdk` from the repository
29
+ root and connect to `http://localhost:8000`.
30
+
31
+ `AsyncClient` accepts the same options. `prepare` explains a SELECT; `execute`
32
+ returns typed columns/rows for read-only queries. `schema()` returns
33
+ visible tables, column types/descriptions and helper documentation. All SQL uses
34
+ `POST /api/v1/sql`; schema discovery uses `GET /api/v1/schema`. ClickHouse enforces
35
+ permissions. The SDK never retries automatically, including failed queries.
36
+
37
+ Public HTML joins use `parse_id` and `node_index`; `document_id` identifies exact
38
+ raw bytes. Public shorthand uses the `public_v1` schema.
39
+
40
+ For notebook/SQLAlchemy integration:
41
+
42
+ ```python
43
+ from periplus_sdk import sql_api
44
+ from sqlalchemy import text
45
+
46
+ engine = sql_api.create_engine(base_url="http://localhost:8000", api_key="ppl_…")
47
+ with engine.connect() as connection:
48
+ print(connection.execute(text("SELECT url FROM public_v1.captures LIMIT 5")).all())
49
+ engine.dispose()
50
+ ```
51
+
52
+ Marimo discovers accessible tables and views through the schema endpoint. Column
53
+ reflection uses `SELECT * ... LIMIT 0` to retrieve native types without reading
54
+ corpus rows; no `SHOW`, `DESCRIBE`, or system-table access is required.
55
+
56
+ The DB-API connection advertises the ClickHouse dialect and converts native
57
+ nullable integer, decimal, date and datetime types. Nested types retain JSON wire
58
+ values. Writes are not exposed through the query API. There are no client
59
+ transactions; each statement is independent.
60
+ Streaming cursors expose incomplete/truncated results explicitly; configure
61
+ `allow_partial` only when partial results suit the application.
62
+
63
+ See [the public schema](../../docs/SCHEMA.md) and [query boundary](../../docs/QUERY.md).