zaturn 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
- zaturn/core.py +42 -3
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/METADATA +10 -3
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/RECORD +7 -7
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/WHEEL +0 -0
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/entry_points.txt +0 -0
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {zaturn-0.1.2.dist-info → zaturn-0.1.3.dist-info}/top_level.txt +0 -0
zaturn/core.py
CHANGED
@@ -20,15 +20,17 @@ def list_sources() -> str:
|
|
20
20
|
|
21
21
|
result = "Available data sources:\n\n"
|
22
22
|
for source in config.SOURCES:
|
23
|
-
|
23
|
+
tables = _list_tables(source)
|
24
|
+
if type(tables) is List:
|
25
|
+
tables = ', '.join(tables)
|
26
|
+
result += f"- {source}\nHas tables: {tables}\n"
|
24
27
|
|
25
28
|
return result
|
26
29
|
except Exception as e:
|
27
30
|
return str(e)
|
28
31
|
|
29
32
|
|
30
|
-
|
31
|
-
def list_tables(source_id: str):
|
33
|
+
def _list_tables(source_id: str):
|
32
34
|
"""
|
33
35
|
Lists names of all tables/datasets in a given data source.
|
34
36
|
Use run_query with appropriate SQL query to determine table structure
|
@@ -67,6 +69,43 @@ def list_tables(source_id: str):
|
|
67
69
|
except Exception as e:
|
68
70
|
return str(e)
|
69
71
|
|
72
|
+
@mcp.tool()
|
73
|
+
def describe_table(source_id: str, table_name: str) -> str:
|
74
|
+
"""
|
75
|
+
Lists columns and their types in the specified table of specified data source.
|
76
|
+
|
77
|
+
Args:
|
78
|
+
source_id: The data source
|
79
|
+
table_name: The table in the data source
|
80
|
+
"""
|
81
|
+
try:
|
82
|
+
source = config.SOURCES.get(source_id)
|
83
|
+
if not source:
|
84
|
+
return f"Source {source_id} Not Found"
|
85
|
+
|
86
|
+
match source['type']:
|
87
|
+
case 'sqlite':
|
88
|
+
result = query_utils.execute_query(source,
|
89
|
+
f"PRAGMA table_info({table_name});"
|
90
|
+
)
|
91
|
+
return result.to_markdown(index=False)
|
92
|
+
|
93
|
+
case 'postgresql':
|
94
|
+
result = query_utils.execute_query(source,
|
95
|
+
f"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{table_name}';"
|
96
|
+
)
|
97
|
+
return result.to_markdown(index=False)
|
98
|
+
|
99
|
+
case "mysql" | "duckdb" | "csv" | "parquet":
|
100
|
+
result = query_utils.execute_query(source,
|
101
|
+
f"DESCRIBE {table_name};"
|
102
|
+
)
|
103
|
+
return result.to_markdown(index=False)
|
104
|
+
|
105
|
+
except Exception as e:
|
106
|
+
return str(e)
|
107
|
+
|
108
|
+
|
70
109
|
@mcp.tool()
|
71
110
|
def run_query(source_id: str, query: str) -> str:
|
72
111
|
"""
|
@@ -1,12 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: zaturn
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: AI Data Analysis MCP
|
5
5
|
Author-email: Karthik Devan <krtdvn@gmail.com>
|
6
6
|
Maintainer-email: Karthik Devan <krtdvn@gmail.com>
|
7
7
|
Project-URL: Homepage, https://github.com/kdqed/zaturn
|
8
8
|
Project-URL: Issues, https://github.com/kdqed/zaturn/issues
|
9
|
-
Project-URL: CI, https://github.com/kdqed/zaturn/actions
|
10
9
|
Requires-Python: >=3.11
|
11
10
|
Description-Content-Type: text/markdown
|
12
11
|
License-File: LICENSE
|
@@ -31,10 +30,16 @@ Dynamic: license-file
|
|
31
30
|
|
32
31
|
# Zaturn: Your Co-Pilot For Data Analytics & BI
|
33
32
|
|
33
|
+
<a href="https://glama.ai/mcp/servers/@kdqed/zaturn">
|
34
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@kdqed/zaturn/badge" alt="Zaturn MCP server" />
|
35
|
+
</a>
|
36
|
+
|
34
37
|
https://github.com/user-attachments/assets/d42dc433-e5ec-4b3e-bef0-5cfc097396ab
|
35
38
|
|
36
39
|
Zaturn is an open source, AI-powered data analysis/BI tool that can connect to your data sources, run SQL queries on it, and give you useful insights. Think of it like vibe data analysis, in the spirit of vibe coding. Currently Zaturn is available as an MCP (Model Context Protocol) Server that can be integrated into your favorite MCP Client (Claude, Cursor, etc.) A full fledged notebook interface is on the roadmap.
|
37
40
|
|
41
|
+
[Join The Discord](https://discord.gg/K8mECeVzpQ)
|
42
|
+
|
38
43
|
## Features:
|
39
44
|
|
40
45
|
### Multiple Data Sources
|
@@ -149,7 +154,9 @@ Analyst:
|
|
149
154
|
```
|
150
155
|
- A native notebook interface
|
151
156
|
|
152
|
-
|
157
|
+
## Support And Feedback
|
158
|
+
|
159
|
+
[Raise an issue](https://github.com/kdqed/zaturn/issues) or [join the Discord](https://discord.gg/K8mECeVzpQ).
|
153
160
|
|
154
161
|
|
155
162
|
## Example Dataset Credits
|
@@ -1,12 +1,12 @@
|
|
1
1
|
zaturn/__init__.py,sha256=v4t5fkRuIJFE-SBxCa5pBjZv0EoC0eWK75nU9iaa7Rg,267
|
2
2
|
zaturn/config.py,sha256=gF5M6Agmixw2A4vpWqIF3ICVnClPeASA51dhp1bkk04,3221
|
3
|
-
zaturn/core.py,sha256=
|
3
|
+
zaturn/core.py,sha256=9zcKb0FbkgGkDtWfBA6_O5NQf6GVKG69HrqOr5nhsLU,4641
|
4
4
|
zaturn/query_utils.py,sha256=zyQjcRnPKGHZdf0XHzQeMxHw9vieZIwXhBbVGP87ml4,2801
|
5
5
|
zaturn/visualizations.py,sha256=Dj08msgZ_DIMEVvJIlybT3cIA3GNkcXVOa9TJsHK2yo,4551
|
6
6
|
zaturn/example_data/all_pokemon_data.csv,sha256=SUlGHHWbehuLg-ch1YUrQ6-xBtqHGw6rIkyn70fAgCk,130893
|
7
|
-
zaturn-0.1.
|
8
|
-
zaturn-0.1.
|
9
|
-
zaturn-0.1.
|
10
|
-
zaturn-0.1.
|
11
|
-
zaturn-0.1.
|
12
|
-
zaturn-0.1.
|
7
|
+
zaturn-0.1.3.dist-info/licenses/LICENSE,sha256=mZSuFlbEBZGl0-8ULRMLdRDbhau5hrWRNQOjytYeaug,1070
|
8
|
+
zaturn-0.1.3.dist-info/METADATA,sha256=BxES8Ifp0fusfDMeB2SNLpSUrZ2qsKWG8rgqhQnfD0Q,5961
|
9
|
+
zaturn-0.1.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
10
|
+
zaturn-0.1.3.dist-info/entry_points.txt,sha256=N1UZC2zvod92_Brs4A2xZiAnt-iGLBNryglXfwhxfj4,43
|
11
|
+
zaturn-0.1.3.dist-info/top_level.txt,sha256=KLUnwQwVZkfd5YCnnqR35MOOs8KLhanPGelvmRo2MVA,7
|
12
|
+
zaturn-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|