zaturn 0.1.1__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/config.py CHANGED
@@ -47,7 +47,7 @@ if not source_list:
47
47
  print("No data sources provided. Loading example dataset for demonstration.")
48
48
  print(f"\nTo load your datasets, add them to {SOURCES_FILE} (one source URL or full file path per line)")
49
49
  print("\nOr use command line args to specify data sources:")
50
- print("uv run --directory /path/to/zaturn mcp_server.py sqlite:///path/to/mydata.db")
50
+ print("zaturn_mcp sqlite:///path/to/mydata.db /path/to/my_file.csv")
51
51
  print(f"\nNOTE: Sources in command line args will be ignored if sources are found in {SOURCES_FILE}")
52
52
 
53
53
  SOURCES = {}
@@ -88,7 +88,6 @@ for s in source_list:
88
88
 
89
89
  # Other Settings
90
90
  RETURN_IMAGES = not args.noimg
91
- print(SOURCES)
92
91
 
93
92
 
94
93
 
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
- result += f"- {source}\n"
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
- @mcp.tool()
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,13 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zaturn
3
- Version: 0.1.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
- Project-URL: Changelog, https://github.com/kdqed/zaturn/releases
9
8
  Project-URL: Issues, https://github.com/kdqed/zaturn/issues
10
- Project-URL: CI, https://github.com/kdqed/zaturn/actions
11
9
  Requires-Python: >=3.11
12
10
  Description-Content-Type: text/markdown
13
11
  License-File: LICENSE
@@ -27,15 +25,21 @@ Requires-Dist: tabulate>=0.9.0
27
25
  Dynamic: license-file
28
26
 
29
27
  <p align="center">
30
- <img src="brand/logo.png" width="128" height="128">
28
+ <img src="https://github.com/kdqed/zaturn/raw/main/brand/logo.png" width="128" height="128">
31
29
  </p>
32
30
 
33
31
  # Zaturn: Your Co-Pilot For Data Analytics & BI
34
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
+
35
37
  https://github.com/user-attachments/assets/d42dc433-e5ec-4b3e-bef0-5cfc097396ab
36
38
 
37
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.
38
40
 
41
+ [Join The Discord](https://discord.gg/K8mECeVzpQ)
42
+
39
43
  ## Features:
40
44
 
41
45
  ### Multiple Data Sources
@@ -69,23 +73,19 @@ Using an MCP like Zaturn will keep your data where it is, and enable AI to draft
69
73
  ## Installation & Setup
70
74
  1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/#installation-methods)
71
75
 
72
- 2. Install Zaturn with uv:
76
+ 2. Install [Zaturn](https://pypi.org/project/zaturn/) with uv:
73
77
  ```bash
74
- $ uv tool install zaturn
78
+ uv tool install zaturn
75
79
  ```
76
80
 
77
81
  3. Add to MCP config, with data sources:
78
82
  ```json
79
83
  "mcpServers": {
80
84
  "zaturn": {
81
- "command": "uv",
85
+ "command": "zaturn_mcp",
82
86
  "args": [
83
- "run",
84
- "--directory",
85
- "/path/to/downloaded/folder",
86
- "mcp_server.py",
87
- "mysql+pymysql://username:password@host:3306/dbname",
88
87
  "postgresql://username:password@host:port/dbname",
88
+ "mysql+pymysql://username:password@host:3306/dbname",
89
89
  "sqlite:////full/path/to/sample_dbs/northwind.db",
90
90
  "/full/path/to/sample_dbs/titanic.parquet",
91
91
  "/full/path/to/sample_dbs/ny_aq.csv",
@@ -95,10 +95,22 @@ $ uv tool install zaturn
95
95
  }
96
96
  ```
97
97
 
98
- If your MCP client does not support images, add the `--noimg` flag after `mcp_server.py`:
98
+ OR add a `sources.txt` to the Zaturn config directory:
99
+ ```
100
+ postgresql://username:password@host:port/dbname
101
+ mysql+pymysql://username:password@host:3306/dbname
102
+ sqlite:////full/path/to/sample_dbs/northwind.db
103
+ /full/path/to/sample_dbs/titanic.parquet
104
+ /full/path/to/sample_dbs/ny_aq.csv
105
+ /full/path/to/sample_dbs/duckdb_sample.duckdb
106
+ ```
107
+
108
+ This file needs to be at `~/.config/zaturn/sources.txt` on Linux/MacOS and at `%APPDATA%\zaturn\sources.txt` on Windows.
109
+
110
+ If your MCP client does not support image rendering, add the `--noimg` argument:
99
111
  ```json
100
112
  ...
101
- "mcp_server.py",
113
+ "args": [
102
114
  "--noimg",
103
115
  "mysql+pymysql://username:password@host:3306/dbname",
104
116
  ...
@@ -114,10 +126,6 @@ You are a helpful data analysis assistant. Use only the tool provided data sourc
114
126
  ```
115
127
  User: List the top 5 customers by revenue for Northwind
116
128
  AI:
117
- [04/08/25 15:16:47] INFO Processing request of type ListToolsRequest server.py:534
118
- [04/08/25 15:16:51] INFO Processing request of type CallToolRequest server.py:534
119
- [04/08/25 15:16:53] INFO Processing request of type CallToolRequest server.py:534
120
- [04/08/25 15:16:55] INFO Processing request of type CallToolRequest server.py:534
121
129
  The top 5 customers by revenue for Northwind are:
122
130
 
123
131
  1. B's Beverages with a revenue of $6,154,115.34
@@ -146,9 +154,11 @@ Analyst:
146
154
  ```
147
155
  - A native notebook interface
148
156
 
149
- If you have any specific requirements please feel free to raise an issue.
157
+ ## Support And Feedback
158
+
159
+ [Raise an issue](https://github.com/kdqed/zaturn/issues) or [join the Discord](https://discord.gg/K8mECeVzpQ).
150
160
 
151
161
 
152
162
  ## Example Dataset Credits
153
163
 
154
- THe [pokemon dataset compiled by Sarah Taha and PokéAPI](https://www.kaggle.com/datasets/sarahtaha/1025-pokemon) has been included under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.
164
+ The [pokemon dataset compiled by Sarah Taha and PokéAPI](https://www.kaggle.com/datasets/sarahtaha/1025-pokemon) has been included under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) license for demonstration purposes.
@@ -0,0 +1,12 @@
1
+ zaturn/__init__.py,sha256=v4t5fkRuIJFE-SBxCa5pBjZv0EoC0eWK75nU9iaa7Rg,267
2
+ zaturn/config.py,sha256=gF5M6Agmixw2A4vpWqIF3ICVnClPeASA51dhp1bkk04,3221
3
+ zaturn/core.py,sha256=9zcKb0FbkgGkDtWfBA6_O5NQf6GVKG69HrqOr5nhsLU,4641
4
+ zaturn/query_utils.py,sha256=zyQjcRnPKGHZdf0XHzQeMxHw9vieZIwXhBbVGP87ml4,2801
5
+ zaturn/visualizations.py,sha256=Dj08msgZ_DIMEVvJIlybT3cIA3GNkcXVOa9TJsHK2yo,4551
6
+ zaturn/example_data/all_pokemon_data.csv,sha256=SUlGHHWbehuLg-ch1YUrQ6-xBtqHGw6rIkyn70fAgCk,130893
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,,
@@ -1,12 +0,0 @@
1
- zaturn/__init__.py,sha256=v4t5fkRuIJFE-SBxCa5pBjZv0EoC0eWK75nU9iaa7Rg,267
2
- zaturn/config.py,sha256=Pq7mNScRnQ4PycDv3cqFVSK9Y9N9V9k3bdGgVo-P4Ns,3253
3
- zaturn/core.py,sha256=sn2oliWVDqhYSAwSe5VbhNamaKAsnlrT3oc6uzffzs4,3267
4
- zaturn/query_utils.py,sha256=zyQjcRnPKGHZdf0XHzQeMxHw9vieZIwXhBbVGP87ml4,2801
5
- zaturn/visualizations.py,sha256=Dj08msgZ_DIMEVvJIlybT3cIA3GNkcXVOa9TJsHK2yo,4551
6
- zaturn/example_data/all_pokemon_data.csv,sha256=SUlGHHWbehuLg-ch1YUrQ6-xBtqHGw6rIkyn70fAgCk,130893
7
- zaturn-0.1.1.dist-info/licenses/LICENSE,sha256=mZSuFlbEBZGl0-8ULRMLdRDbhau5hrWRNQOjytYeaug,1070
8
- zaturn-0.1.1.dist-info/METADATA,sha256=etCpT5a2AxDSP_hc7_ic6ecEd_aZYGsQNdvzTWtbQbU,5834
9
- zaturn-0.1.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
10
- zaturn-0.1.1.dist-info/entry_points.txt,sha256=N1UZC2zvod92_Brs4A2xZiAnt-iGLBNryglXfwhxfj4,43
11
- zaturn-0.1.1.dist-info/top_level.txt,sha256=KLUnwQwVZkfd5YCnnqR35MOOs8KLhanPGelvmRo2MVA,7
12
- zaturn-0.1.1.dist-info/RECORD,,
File without changes