QuerySUTRA 0.3.1__tar.gz → 0.3.3__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 (46) hide show
  1. querysutra-0.3.3/PKG-INFO +285 -0
  2. querysutra-0.3.3/QuerySUTRA.egg-info/PKG-INFO +285 -0
  3. {querysutra-0.3.1 → querysutra-0.3.3}/QuerySUTRA.egg-info/SOURCES.txt +0 -4
  4. querysutra-0.3.3/README.md +249 -0
  5. {querysutra-0.3.1 → querysutra-0.3.3}/pyproject.toml +6 -19
  6. {querysutra-0.3.1 → querysutra-0.3.3}/setup.py +1 -1
  7. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/__init__.py +2 -2
  8. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/sutra.py +281 -463
  9. querysutra-0.3.1/.gitignore +0 -50
  10. querysutra-0.3.1/PKG-INFO +0 -429
  11. querysutra-0.3.1/QuerySUTRA.egg-info/PKG-INFO +0 -429
  12. querysutra-0.3.1/README.md +0 -388
  13. querysutra-0.3.1/config.py +0 -48
  14. querysutra-0.3.1/main.py +0 -109
  15. querysutra-0.3.1/test_openapi.py +0 -17
  16. {querysutra-0.3.1 → querysutra-0.3.3}/LICENSE +0 -0
  17. {querysutra-0.3.1 → querysutra-0.3.3}/MANIFEST.in +0 -0
  18. {querysutra-0.3.1 → querysutra-0.3.3}/QuerySUTRA.egg-info/dependency_links.txt +0 -0
  19. {querysutra-0.3.1 → querysutra-0.3.3}/QuerySUTRA.egg-info/requires.txt +0 -0
  20. {querysutra-0.3.1 → querysutra-0.3.3}/QuerySUTRA.egg-info/top_level.txt +0 -0
  21. {querysutra-0.3.1 → querysutra-0.3.3}/examples/quickstart.py +0 -0
  22. {querysutra-0.3.1 → querysutra-0.3.3}/examples/sutra_usage_guide.ipynb +0 -0
  23. {querysutra-0.3.1 → querysutra-0.3.3}/examples/usage_guide.ipynb +0 -0
  24. {querysutra-0.3.1 → querysutra-0.3.3}/requirements.txt +0 -0
  25. {querysutra-0.3.1 → querysutra-0.3.3}/setup.cfg +0 -0
  26. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/cache_manager.py +0 -0
  27. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/clear_cache.py +0 -0
  28. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/core.py +0 -0
  29. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/data_loader.py +0 -0
  30. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/database_manager.py +0 -0
  31. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/direct_query.py +0 -0
  32. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/feedback.py +0 -0
  33. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/feedback_matcher.py +0 -0
  34. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/nlp_processor.py +0 -0
  35. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/schema_embeddings.py +0 -0
  36. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/schema_generator.py +0 -0
  37. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/sutra_client.py +0 -0
  38. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/sutra_core.py +0 -0
  39. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/sutra_simple.py +0 -0
  40. {querysutra-0.3.1 → querysutra-0.3.3}/sutra/visualizer.py +0 -0
  41. {querysutra-0.3.1 → querysutra-0.3.3}/tests/__init__.py +0 -0
  42. {querysutra-0.3.1 → querysutra-0.3.3}/tests/test_modules.py +0 -0
  43. {querysutra-0.3.1 → querysutra-0.3.3}/tests/test_sutra.py +0 -0
  44. {querysutra-0.3.1 → querysutra-0.3.3}/utils/__init__.py +0 -0
  45. {querysutra-0.3.1 → querysutra-0.3.3}/utils/file_utils.py +0 -0
  46. {querysutra-0.3.1 → querysutra-0.3.3}/utils/text_utils.py +0 -0
@@ -0,0 +1,285 @@
1
+ Metadata-Version: 2.4
2
+ Name: QuerySUTRA
3
+ Version: 0.3.3
4
+ Summary: SUTRA: Structured-Unstructured-Text-Retrieval-Architecture
5
+ Home-page: https://github.com/yourusername/querysutra
6
+ Author: Aditya Batta
7
+ Author-email:
8
+ License: MIT
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas>=1.3.0
13
+ Requires-Dist: numpy>=1.21.0
14
+ Requires-Dist: openai>=1.0.0
15
+ Requires-Dist: plotly>=5.0.0
16
+ Requires-Dist: matplotlib>=3.3.0
17
+ Requires-Dist: PyPDF2>=3.0.0
18
+ Requires-Dist: python-docx>=0.8.11
19
+ Requires-Dist: openpyxl>=3.0.0
20
+ Provides-Extra: mysql
21
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "mysql"
22
+ Requires-Dist: mysql-connector-python>=8.0.0; extra == "mysql"
23
+ Provides-Extra: postgres
24
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "postgres"
25
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
26
+ Provides-Extra: embeddings
27
+ Requires-Dist: sentence-transformers>=2.0.0; extra == "embeddings"
28
+ Provides-Extra: all
29
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "all"
30
+ Requires-Dist: mysql-connector-python>=8.0.0; extra == "all"
31
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
32
+ Requires-Dist: sentence-transformers>=2.0.0; extra == "all"
33
+ Dynamic: home-page
34
+ Dynamic: license-file
35
+ Dynamic: requires-python
36
+
37
+ # QuerySUTRA
38
+
39
+ **SUTRA: Structured-Unstructured-Text-Retrieval-Architecture**
40
+
41
+ Professional Python library for AI-powered data analysis with automatic entity extraction, natural language querying, and intelligent caching.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install QuerySUTRA
47
+
48
+ # Optional features
49
+ pip install QuerySUTRA[embeddings] # Smart caching
50
+ pip install QuerySUTRA[mysql] # MySQL support
51
+ pip install QuerySUTRA[postgres] # PostgreSQL support
52
+ pip install QuerySUTRA[all] # All features
53
+ ```
54
+
55
+ ## Key Features
56
+
57
+ ### 1. Automatic Multi-Table Creation
58
+ Upload PDFs, Word documents, or text files and automatically extract structured entities.
59
+
60
+ ```python
61
+ from sutra import SUTRA
62
+
63
+ sutra = SUTRA(api_key="your-openai-key")
64
+ sutra.upload("employee_data.pdf")
65
+
66
+ # Automatically creates:
67
+ # - employee_data_people (20 rows, 6 columns)
68
+ # - employee_data_contacts (20 rows, 4 columns)
69
+ # - employee_data_events (15 rows, 4 columns)
70
+ ```
71
+
72
+ ### 2. Natural Language Querying
73
+
74
+ ```python
75
+ result = sutra.ask("Show me all people from New York")
76
+ print(result.data)
77
+
78
+ # With visualization
79
+ result = sutra.ask("Show sales by region", viz="pie")
80
+ ```
81
+
82
+ ### 3. Load Existing Databases
83
+
84
+ ```python
85
+ # Load SQLite database
86
+ sutra = SUTRA.load_from_db("sutra.db", api_key="your-key")
87
+
88
+ # Connect to MySQL
89
+ sutra = SUTRA.connect_mysql("localhost", "root", "password", "database")
90
+
91
+ # Connect to PostgreSQL
92
+ sutra = SUTRA.connect_postgres("localhost", "postgres", "password", "database")
93
+ ```
94
+
95
+ ### 4. Custom Visualizations
96
+
97
+ ```python
98
+ result = sutra.ask("Sales by region", viz="pie") # Pie chart
99
+ result = sutra.ask("Trends", viz="line") # Line chart
100
+ result = sutra.ask("Compare", viz="bar") # Bar chart
101
+ result = sutra.ask("Correlation", viz="scatter") # Scatter plot
102
+ result = sutra.ask("Data", viz="table") # Table view
103
+ result = sutra.ask("Analysis", viz="heatmap") # Heatmap
104
+ result = sutra.ask("Auto", viz=True) # Auto-detect
105
+ ```
106
+
107
+ ### 5. Smart Fuzzy Matching
108
+
109
+ ```python
110
+ sutra = SUTRA(api_key="your-key", fuzzy_match=True)
111
+
112
+ # "New York City" matches "New York" automatically
113
+ result = sutra.ask("Who are from New York City?")
114
+ ```
115
+
116
+ ### 6. Intelligent Caching with Embeddings
117
+
118
+ ```python
119
+ sutra = SUTRA(api_key="your-key", use_embeddings=True)
120
+
121
+ result = sutra.ask("Show sales") # Calls API
122
+ result = sutra.ask("Display sales data") # Uses cache (no API call)
123
+ ```
124
+
125
+ ### 7. Irrelevant Query Detection
126
+
127
+ ```python
128
+ sutra = SUTRA(api_key="your-key", check_relevance=True)
129
+
130
+ result = sutra.ask("What is the weather?")
131
+ # Warns: "This question seems irrelevant to your database"
132
+ ```
133
+
134
+ ### 8. Direct SQL Access (Free)
135
+
136
+ ```python
137
+ result = sutra.sql("SELECT * FROM people WHERE city='New York'")
138
+ print(result.data)
139
+ ```
140
+
141
+ ## Complete Configuration
142
+
143
+ ```python
144
+ sutra = SUTRA(
145
+ api_key="your-openai-key",
146
+ db="database.db", # SQLite path
147
+ use_embeddings=True, # Smart caching (saves API calls)
148
+ check_relevance=True, # Detect irrelevant queries
149
+ fuzzy_match=True, # Better NLP
150
+ cache_queries=True # Simple caching
151
+ )
152
+ ```
153
+
154
+ ## Supported Formats
155
+
156
+ CSV, Excel, JSON, SQL, PDF, Word, Text, Pandas DataFrame
157
+
158
+ ## Usage Examples
159
+
160
+ ### Basic Workflow
161
+
162
+ ```python
163
+ sutra = SUTRA(api_key="your-key")
164
+ sutra.upload("data.pdf")
165
+ sutra.tables() # View tables
166
+ sutra.schema() # View schema
167
+ sutra.peek("table_name", n=10) # Preview data
168
+ result = sutra.ask("Your question?")
169
+ ```
170
+
171
+ ### Database Export
172
+
173
+ ```python
174
+ sutra.export_db("backup.db", format="sqlite")
175
+ sutra.export_db("schema.sql", format="sql")
176
+ sutra.save_to_mysql("localhost", "root", "pass", "db")
177
+ sutra.save_to_postgres("localhost", "postgres", "pass", "db")
178
+ sutra.backup("./backups")
179
+ ```
180
+
181
+ ## How It Works
182
+
183
+ ### Entity Extraction Example
184
+
185
+ **Input PDF:**
186
+ ```
187
+ John Doe lives at 123 Main St, Dallas. Email: john@company.com.
188
+ Sarah Smith lives at 456 Oak Ave, Boston. Email: sarah@company.com.
189
+ ```
190
+
191
+ **Output Tables:**
192
+
193
+ **people**
194
+ | id | name | address | city | email |
195
+ |----|------|---------|------|-------|
196
+ | 1 | John Doe | 123 Main St | Dallas | john@company.com |
197
+ | 2 | Sarah Smith | 456 Oak Ave | Boston | sarah@company.com |
198
+
199
+ ### Embeddings for Smart Caching
200
+
201
+ Uses `all-MiniLM-L6-v2` model (80MB, runs locally):
202
+ - Query 1: "Show sales" → API call
203
+ - Query 2: "Display sales" → 92% similar → Cached (no API call)
204
+
205
+ ### Fuzzy Matching
206
+
207
+ - Query: "New York City"
208
+ - Database: ["New York", "Dallas", "Boston"]
209
+ - Match: "New York City" → "New York" (85% similar)
210
+
211
+ ## API Reference
212
+
213
+ ### Class Methods
214
+
215
+ `SUTRA.load_from_db(db_path, api_key, **kwargs)` - Load existing SQLite database
216
+
217
+ `SUTRA.connect_mysql(host, user, password, database, ...)` - Connect to MySQL
218
+
219
+ `SUTRA.connect_postgres(host, user, password, database, ...)` - Connect to PostgreSQL
220
+
221
+ ### Instance Methods
222
+
223
+ `upload(data, name=None)` - Upload data
224
+
225
+ `ask(question, viz=False, table=None)` - Natural language query
226
+
227
+ `sql(query, viz=False)` - Raw SQL query
228
+
229
+ `tables()` - List all tables
230
+
231
+ `schema(table=None)` - Show schema
232
+
233
+ `peek(table=None, n=5)` - Preview data
234
+
235
+ `export_db(path, format)` - Export database
236
+
237
+ `save_to_mysql(...)` - Export to MySQL
238
+
239
+ `save_to_postgres(...)` - Export to PostgreSQL
240
+
241
+ `backup(path=None)` - Create backup
242
+
243
+ `close()` - Close connection
244
+
245
+ ## Performance Tips
246
+
247
+ 1. Use `load_from_db()` to avoid re-uploading
248
+ 2. Use `sql()` for complex queries (no API cost)
249
+ 3. Enable `use_embeddings=True` for caching
250
+ 4. Enable `cache_queries=True` for exact matches
251
+
252
+ ## Troubleshooting
253
+
254
+ **No API key error:** `sutra = SUTRA(api_key="sk-...")`
255
+
256
+ **PDF fails:** `pip install PyPDF2`
257
+
258
+ **MySQL error:** `pip install QuerySUTRA[mysql]`
259
+
260
+ **Embeddings error:** `pip install QuerySUTRA[embeddings]`
261
+
262
+ ## Requirements
263
+
264
+ - Python 3.8+
265
+ - OpenAI API key
266
+ - 100MB disk space (if using embeddings)
267
+
268
+ ## License
269
+
270
+ MIT License
271
+
272
+ ## Changelog
273
+
274
+ ### v0.3.1
275
+ - Semantic embeddings for smart caching
276
+ - Fuzzy matching for better NLP
277
+ - Irrelevant query detection
278
+ - Load existing databases
279
+ - MySQL/PostgreSQL connectivity
280
+ - Custom visualizations
281
+ - All features optional
282
+
283
+ ---
284
+
285
+ **Made by Aditya Batta**
@@ -0,0 +1,285 @@
1
+ Metadata-Version: 2.4
2
+ Name: QuerySUTRA
3
+ Version: 0.3.3
4
+ Summary: SUTRA: Structured-Unstructured-Text-Retrieval-Architecture
5
+ Home-page: https://github.com/yourusername/querysutra
6
+ Author: Aditya Batta
7
+ Author-email:
8
+ License: MIT
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas>=1.3.0
13
+ Requires-Dist: numpy>=1.21.0
14
+ Requires-Dist: openai>=1.0.0
15
+ Requires-Dist: plotly>=5.0.0
16
+ Requires-Dist: matplotlib>=3.3.0
17
+ Requires-Dist: PyPDF2>=3.0.0
18
+ Requires-Dist: python-docx>=0.8.11
19
+ Requires-Dist: openpyxl>=3.0.0
20
+ Provides-Extra: mysql
21
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "mysql"
22
+ Requires-Dist: mysql-connector-python>=8.0.0; extra == "mysql"
23
+ Provides-Extra: postgres
24
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "postgres"
25
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
26
+ Provides-Extra: embeddings
27
+ Requires-Dist: sentence-transformers>=2.0.0; extra == "embeddings"
28
+ Provides-Extra: all
29
+ Requires-Dist: sqlalchemy>=1.4.0; extra == "all"
30
+ Requires-Dist: mysql-connector-python>=8.0.0; extra == "all"
31
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
32
+ Requires-Dist: sentence-transformers>=2.0.0; extra == "all"
33
+ Dynamic: home-page
34
+ Dynamic: license-file
35
+ Dynamic: requires-python
36
+
37
+ # QuerySUTRA
38
+
39
+ **SUTRA: Structured-Unstructured-Text-Retrieval-Architecture**
40
+
41
+ Professional Python library for AI-powered data analysis with automatic entity extraction, natural language querying, and intelligent caching.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install QuerySUTRA
47
+
48
+ # Optional features
49
+ pip install QuerySUTRA[embeddings] # Smart caching
50
+ pip install QuerySUTRA[mysql] # MySQL support
51
+ pip install QuerySUTRA[postgres] # PostgreSQL support
52
+ pip install QuerySUTRA[all] # All features
53
+ ```
54
+
55
+ ## Key Features
56
+
57
+ ### 1. Automatic Multi-Table Creation
58
+ Upload PDFs, Word documents, or text files and automatically extract structured entities.
59
+
60
+ ```python
61
+ from sutra import SUTRA
62
+
63
+ sutra = SUTRA(api_key="your-openai-key")
64
+ sutra.upload("employee_data.pdf")
65
+
66
+ # Automatically creates:
67
+ # - employee_data_people (20 rows, 6 columns)
68
+ # - employee_data_contacts (20 rows, 4 columns)
69
+ # - employee_data_events (15 rows, 4 columns)
70
+ ```
71
+
72
+ ### 2. Natural Language Querying
73
+
74
+ ```python
75
+ result = sutra.ask("Show me all people from New York")
76
+ print(result.data)
77
+
78
+ # With visualization
79
+ result = sutra.ask("Show sales by region", viz="pie")
80
+ ```
81
+
82
+ ### 3. Load Existing Databases
83
+
84
+ ```python
85
+ # Load SQLite database
86
+ sutra = SUTRA.load_from_db("sutra.db", api_key="your-key")
87
+
88
+ # Connect to MySQL
89
+ sutra = SUTRA.connect_mysql("localhost", "root", "password", "database")
90
+
91
+ # Connect to PostgreSQL
92
+ sutra = SUTRA.connect_postgres("localhost", "postgres", "password", "database")
93
+ ```
94
+
95
+ ### 4. Custom Visualizations
96
+
97
+ ```python
98
+ result = sutra.ask("Sales by region", viz="pie") # Pie chart
99
+ result = sutra.ask("Trends", viz="line") # Line chart
100
+ result = sutra.ask("Compare", viz="bar") # Bar chart
101
+ result = sutra.ask("Correlation", viz="scatter") # Scatter plot
102
+ result = sutra.ask("Data", viz="table") # Table view
103
+ result = sutra.ask("Analysis", viz="heatmap") # Heatmap
104
+ result = sutra.ask("Auto", viz=True) # Auto-detect
105
+ ```
106
+
107
+ ### 5. Smart Fuzzy Matching
108
+
109
+ ```python
110
+ sutra = SUTRA(api_key="your-key", fuzzy_match=True)
111
+
112
+ # "New York City" matches "New York" automatically
113
+ result = sutra.ask("Who are from New York City?")
114
+ ```
115
+
116
+ ### 6. Intelligent Caching with Embeddings
117
+
118
+ ```python
119
+ sutra = SUTRA(api_key="your-key", use_embeddings=True)
120
+
121
+ result = sutra.ask("Show sales") # Calls API
122
+ result = sutra.ask("Display sales data") # Uses cache (no API call)
123
+ ```
124
+
125
+ ### 7. Irrelevant Query Detection
126
+
127
+ ```python
128
+ sutra = SUTRA(api_key="your-key", check_relevance=True)
129
+
130
+ result = sutra.ask("What is the weather?")
131
+ # Warns: "This question seems irrelevant to your database"
132
+ ```
133
+
134
+ ### 8. Direct SQL Access (Free)
135
+
136
+ ```python
137
+ result = sutra.sql("SELECT * FROM people WHERE city='New York'")
138
+ print(result.data)
139
+ ```
140
+
141
+ ## Complete Configuration
142
+
143
+ ```python
144
+ sutra = SUTRA(
145
+ api_key="your-openai-key",
146
+ db="database.db", # SQLite path
147
+ use_embeddings=True, # Smart caching (saves API calls)
148
+ check_relevance=True, # Detect irrelevant queries
149
+ fuzzy_match=True, # Better NLP
150
+ cache_queries=True # Simple caching
151
+ )
152
+ ```
153
+
154
+ ## Supported Formats
155
+
156
+ CSV, Excel, JSON, SQL, PDF, Word, Text, Pandas DataFrame
157
+
158
+ ## Usage Examples
159
+
160
+ ### Basic Workflow
161
+
162
+ ```python
163
+ sutra = SUTRA(api_key="your-key")
164
+ sutra.upload("data.pdf")
165
+ sutra.tables() # View tables
166
+ sutra.schema() # View schema
167
+ sutra.peek("table_name", n=10) # Preview data
168
+ result = sutra.ask("Your question?")
169
+ ```
170
+
171
+ ### Database Export
172
+
173
+ ```python
174
+ sutra.export_db("backup.db", format="sqlite")
175
+ sutra.export_db("schema.sql", format="sql")
176
+ sutra.save_to_mysql("localhost", "root", "pass", "db")
177
+ sutra.save_to_postgres("localhost", "postgres", "pass", "db")
178
+ sutra.backup("./backups")
179
+ ```
180
+
181
+ ## How It Works
182
+
183
+ ### Entity Extraction Example
184
+
185
+ **Input PDF:**
186
+ ```
187
+ John Doe lives at 123 Main St, Dallas. Email: john@company.com.
188
+ Sarah Smith lives at 456 Oak Ave, Boston. Email: sarah@company.com.
189
+ ```
190
+
191
+ **Output Tables:**
192
+
193
+ **people**
194
+ | id | name | address | city | email |
195
+ |----|------|---------|------|-------|
196
+ | 1 | John Doe | 123 Main St | Dallas | john@company.com |
197
+ | 2 | Sarah Smith | 456 Oak Ave | Boston | sarah@company.com |
198
+
199
+ ### Embeddings for Smart Caching
200
+
201
+ Uses `all-MiniLM-L6-v2` model (80MB, runs locally):
202
+ - Query 1: "Show sales" → API call
203
+ - Query 2: "Display sales" → 92% similar → Cached (no API call)
204
+
205
+ ### Fuzzy Matching
206
+
207
+ - Query: "New York City"
208
+ - Database: ["New York", "Dallas", "Boston"]
209
+ - Match: "New York City" → "New York" (85% similar)
210
+
211
+ ## API Reference
212
+
213
+ ### Class Methods
214
+
215
+ `SUTRA.load_from_db(db_path, api_key, **kwargs)` - Load existing SQLite database
216
+
217
+ `SUTRA.connect_mysql(host, user, password, database, ...)` - Connect to MySQL
218
+
219
+ `SUTRA.connect_postgres(host, user, password, database, ...)` - Connect to PostgreSQL
220
+
221
+ ### Instance Methods
222
+
223
+ `upload(data, name=None)` - Upload data
224
+
225
+ `ask(question, viz=False, table=None)` - Natural language query
226
+
227
+ `sql(query, viz=False)` - Raw SQL query
228
+
229
+ `tables()` - List all tables
230
+
231
+ `schema(table=None)` - Show schema
232
+
233
+ `peek(table=None, n=5)` - Preview data
234
+
235
+ `export_db(path, format)` - Export database
236
+
237
+ `save_to_mysql(...)` - Export to MySQL
238
+
239
+ `save_to_postgres(...)` - Export to PostgreSQL
240
+
241
+ `backup(path=None)` - Create backup
242
+
243
+ `close()` - Close connection
244
+
245
+ ## Performance Tips
246
+
247
+ 1. Use `load_from_db()` to avoid re-uploading
248
+ 2. Use `sql()` for complex queries (no API cost)
249
+ 3. Enable `use_embeddings=True` for caching
250
+ 4. Enable `cache_queries=True` for exact matches
251
+
252
+ ## Troubleshooting
253
+
254
+ **No API key error:** `sutra = SUTRA(api_key="sk-...")`
255
+
256
+ **PDF fails:** `pip install PyPDF2`
257
+
258
+ **MySQL error:** `pip install QuerySUTRA[mysql]`
259
+
260
+ **Embeddings error:** `pip install QuerySUTRA[embeddings]`
261
+
262
+ ## Requirements
263
+
264
+ - Python 3.8+
265
+ - OpenAI API key
266
+ - 100MB disk space (if using embeddings)
267
+
268
+ ## License
269
+
270
+ MIT License
271
+
272
+ ## Changelog
273
+
274
+ ### v0.3.1
275
+ - Semantic embeddings for smart caching
276
+ - Fuzzy matching for better NLP
277
+ - Irrelevant query detection
278
+ - Load existing databases
279
+ - MySQL/PostgreSQL connectivity
280
+ - Custom visualizations
281
+ - All features optional
282
+
283
+ ---
284
+
285
+ **Made by Aditya Batta**
@@ -1,13 +1,9 @@
1
- .gitignore
2
1
  LICENSE
3
2
  MANIFEST.in
4
3
  README.md
5
- config.py
6
- main.py
7
4
  pyproject.toml
8
5
  requirements.txt
9
6
  setup.py
10
- test_openapi.py
11
7
  QuerySUTRA.egg-info/PKG-INFO
12
8
  QuerySUTRA.egg-info/SOURCES.txt
13
9
  QuerySUTRA.egg-info/dependency_links.txt