meaningai 0.1.9__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 meaningAI Contributors
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,167 @@
1
+ Metadata-Version: 2.4
2
+ Name: meaningai
3
+ Version: 0.1.9
4
+ Summary: Python client for the meaningAI local data intelligence API
5
+ Author: meaningAI Contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 meaningAI Contributors
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/meaningAI/meaningAI
29
+ Project-URL: Repository, https://github.com/meaningAI/meaningAI
30
+ Project-URL: Issues, https://github.com/meaningAI/meaningAI/issues
31
+ Keywords: data,analytics,ai,duckdb,pandas,polars,sql
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Typing :: Typed
43
+ Requires-Python: >=3.9
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: requests>=2.28.0
47
+ Provides-Extra: async
48
+ Requires-Dist: httpx>=0.25.0; extra == "async"
49
+ Dynamic: license-file
50
+
51
+ # meaningai
52
+
53
+ Official Python client for the [meaningAI](https://github.com/meaningAI/meaningAI) local data intelligence API.
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ pip install meaningai
59
+ ```
60
+
61
+ For `AsyncMeaningAI` (backed by `httpx`):
62
+
63
+ ```bash
64
+ pip install "meaningai[async]"
65
+ ```
66
+
67
+ ## Quickstart
68
+
69
+ ```python
70
+ from meaningai import MeaningAI
71
+
72
+ client = MeaningAI("http://localhost:11888")
73
+
74
+ # Ask a question against a local CSV, Parquet, Excel file, or Pandas/Polars DataFrame.
75
+ # API/SDK defaults to response_format="json" for structured downstream consumption;
76
+ # pass response_format="text" for narrative markdown output.
77
+ res = client.ask("sales.csv", "Top 5 products by revenue with a chart")
78
+ print(res.get("specialist"), res["answer"]) # specialist: "analytics" | "engineering" | "data_qa"
79
+ client.download_artifacts(res, dest_dir="./outputs")
80
+ ```
81
+
82
+ ### Multi-File Joins & DataFrames
83
+
84
+ ```python
85
+ import pandas as pd
86
+
87
+ df = pd.read_csv("orders.csv")
88
+ res = client.ask(["customers.csv", df], "Top 10 customers by lifetime spend")
89
+ ```
90
+
91
+ ## Streaming Responses
92
+
93
+ Use `ask_stream_text()` to stream tokens as they arrive and still receive the final result payload (including generated code and artifacts):
94
+
95
+ ```python
96
+ res = client.ask_stream_text(
97
+ "sales.csv",
98
+ "Summarize monthly revenue trends",
99
+ on_token=lambda tok: print(tok, end="", flush=True),
100
+ )
101
+ client.download_artifacts(res, dest_dir="./outputs")
102
+ ```
103
+
104
+ Or consume raw Server-Sent Events directly with `stream()`:
105
+
106
+ ```python
107
+ for event, data in client.stream("sales.csv", "Summarize monthly revenue trends", response_format="text"):
108
+ if event in ("insights_delta", "chat_delta"):
109
+ print(data.get("delta", ""), end="", flush=True)
110
+ elif event == "final_insights":
111
+ print("\nInsights:", data.get("insights"))
112
+ elif event == "done":
113
+ print("\nDone:", data)
114
+ ```
115
+
116
+ ## Async Client
117
+
118
+ ```python
119
+ import asyncio
120
+ from meaningai import AsyncMeaningAI
121
+
122
+ async def main():
123
+ async with AsyncMeaningAI("http://localhost:11888") as client:
124
+ res = await client.ask("sales.csv", "Monthly revenue growth rate")
125
+ print(res["answer"])
126
+ await client.download_artifacts(res, dest_dir="./outputs")
127
+
128
+ asyncio.run(main())
129
+ ```
130
+
131
+ ## Executive Briefs & Reusable Playbooks
132
+
133
+ ```python
134
+ dataset_id = client.upload("sales.csv")
135
+
136
+ # Zero-latency executive summary (shape, caveats, starter prompts)
137
+ brief = client.brief(dataset_id)
138
+
139
+ # Save a verified sandbox script and re-run it on new files with zero LLM calls
140
+ pb = client.save_playbook(
141
+ "Monthly KPI Report",
142
+ code=res["code"],
143
+ engine="duckdb",
144
+ source_dataset_id=dataset_id,
145
+ )
146
+ run = client.run_playbook(pb["id"], "sales_next_month.csv")
147
+ ```
148
+
149
+ ## Database & URL Datasources
150
+
151
+ ```python
152
+ # Test and connect a PostgreSQL, MySQL, SQLite, or URL datasource
153
+ client.test_source("postgres", "postgresql://user:pass@localhost:5432/analytics")
154
+ ds = client.connect_source(
155
+ "postgres",
156
+ "postgresql://user:pass@localhost:5432/analytics",
157
+ name="orders",
158
+ table_name="public.orders",
159
+ )
160
+
161
+ # Ask using the connected dataset ID
162
+ res = client.ask(ds["dataset_id"], "What was total revenue last quarter?")
163
+
164
+ # Re-sync and rename
165
+ client.sync_source(ds["dataset_id"])
166
+ client.rename(ds["dataset_id"], "orders_q4")
167
+ ```
@@ -0,0 +1,117 @@
1
+ # meaningai
2
+
3
+ Official Python client for the [meaningAI](https://github.com/meaningAI/meaningAI) local data intelligence API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install meaningai
9
+ ```
10
+
11
+ For `AsyncMeaningAI` (backed by `httpx`):
12
+
13
+ ```bash
14
+ pip install "meaningai[async]"
15
+ ```
16
+
17
+ ## Quickstart
18
+
19
+ ```python
20
+ from meaningai import MeaningAI
21
+
22
+ client = MeaningAI("http://localhost:11888")
23
+
24
+ # Ask a question against a local CSV, Parquet, Excel file, or Pandas/Polars DataFrame.
25
+ # API/SDK defaults to response_format="json" for structured downstream consumption;
26
+ # pass response_format="text" for narrative markdown output.
27
+ res = client.ask("sales.csv", "Top 5 products by revenue with a chart")
28
+ print(res.get("specialist"), res["answer"]) # specialist: "analytics" | "engineering" | "data_qa"
29
+ client.download_artifacts(res, dest_dir="./outputs")
30
+ ```
31
+
32
+ ### Multi-File Joins & DataFrames
33
+
34
+ ```python
35
+ import pandas as pd
36
+
37
+ df = pd.read_csv("orders.csv")
38
+ res = client.ask(["customers.csv", df], "Top 10 customers by lifetime spend")
39
+ ```
40
+
41
+ ## Streaming Responses
42
+
43
+ Use `ask_stream_text()` to stream tokens as they arrive and still receive the final result payload (including generated code and artifacts):
44
+
45
+ ```python
46
+ res = client.ask_stream_text(
47
+ "sales.csv",
48
+ "Summarize monthly revenue trends",
49
+ on_token=lambda tok: print(tok, end="", flush=True),
50
+ )
51
+ client.download_artifacts(res, dest_dir="./outputs")
52
+ ```
53
+
54
+ Or consume raw Server-Sent Events directly with `stream()`:
55
+
56
+ ```python
57
+ for event, data in client.stream("sales.csv", "Summarize monthly revenue trends", response_format="text"):
58
+ if event in ("insights_delta", "chat_delta"):
59
+ print(data.get("delta", ""), end="", flush=True)
60
+ elif event == "final_insights":
61
+ print("\nInsights:", data.get("insights"))
62
+ elif event == "done":
63
+ print("\nDone:", data)
64
+ ```
65
+
66
+ ## Async Client
67
+
68
+ ```python
69
+ import asyncio
70
+ from meaningai import AsyncMeaningAI
71
+
72
+ async def main():
73
+ async with AsyncMeaningAI("http://localhost:11888") as client:
74
+ res = await client.ask("sales.csv", "Monthly revenue growth rate")
75
+ print(res["answer"])
76
+ await client.download_artifacts(res, dest_dir="./outputs")
77
+
78
+ asyncio.run(main())
79
+ ```
80
+
81
+ ## Executive Briefs & Reusable Playbooks
82
+
83
+ ```python
84
+ dataset_id = client.upload("sales.csv")
85
+
86
+ # Zero-latency executive summary (shape, caveats, starter prompts)
87
+ brief = client.brief(dataset_id)
88
+
89
+ # Save a verified sandbox script and re-run it on new files with zero LLM calls
90
+ pb = client.save_playbook(
91
+ "Monthly KPI Report",
92
+ code=res["code"],
93
+ engine="duckdb",
94
+ source_dataset_id=dataset_id,
95
+ )
96
+ run = client.run_playbook(pb["id"], "sales_next_month.csv")
97
+ ```
98
+
99
+ ## Database & URL Datasources
100
+
101
+ ```python
102
+ # Test and connect a PostgreSQL, MySQL, SQLite, or URL datasource
103
+ client.test_source("postgres", "postgresql://user:pass@localhost:5432/analytics")
104
+ ds = client.connect_source(
105
+ "postgres",
106
+ "postgresql://user:pass@localhost:5432/analytics",
107
+ name="orders",
108
+ table_name="public.orders",
109
+ )
110
+
111
+ # Ask using the connected dataset ID
112
+ res = client.ask(ds["dataset_id"], "What was total revenue last quarter?")
113
+
114
+ # Re-sync and rename
115
+ client.sync_source(ds["dataset_id"])
116
+ client.rename(ds["dataset_id"], "orders_q4")
117
+ ```
@@ -0,0 +1,8 @@
1
+ """Python client for the meaningAI local data intelligence API."""
2
+
3
+ from .async_client import AsyncMeaningAI
4
+ from .client import DataInput, MeaningAI, MeaningAIError
5
+
6
+ __version__ = "0.1.9"
7
+
8
+ __all__ = ["AsyncMeaningAI", "DataInput", "MeaningAI", "MeaningAIError", "__version__"]