sqlshell 0.2.2__py3-none-any.whl → 0.3.0__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.

Potentially problematic release.


This version of sqlshell might be problematic. Click here for more details.

@@ -0,0 +1,400 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqlshell
3
+ Version: 0.3.0
4
+ Summary: A powerful SQL shell with GUI interface for data analysis
5
+ Author: SQLShell Team
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/oyvinrog/SQLShell
8
+ Keywords: sql,data analysis,gui,duckdb
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: pandas>=2.0.0
19
+ Requires-Dist: numpy>=1.24.0
20
+ Requires-Dist: PyQt6>=6.4.0
21
+ Requires-Dist: duckdb>=0.9.0
22
+ Requires-Dist: openpyxl>=3.1.0
23
+ Requires-Dist: pyarrow>=14.0.1
24
+ Requires-Dist: fastparquet>=2023.10.1
25
+ Requires-Dist: xlrd>=2.0.1
26
+ Requires-Dist: deltalake
27
+ Requires-Dist: Pillow>=10.0.0
28
+ Requires-Dist: xgboost
29
+ Requires-Dist: scikit-learn
30
+ Requires-Dist: matplotlib>=3.10.0
31
+ Requires-Dist: scipy>=1.15.0
32
+ Requires-Dist: seaborn>=0.13.0
33
+ Requires-Dist: nltk>=3.8.1
34
+
35
+ # SQLShell
36
+
37
+ <div align="center">
38
+
39
+ <img src="https://raw.githubusercontent.com/oyvinrog/SQLShell/main/assets/images/sqlshell_logo.png" alt="SQLShell Logo" width="180" height="auto">
40
+
41
+ **A powerful SQL shell with GUI interface for data analysis**
42
+
43
+ <img src="https://raw.githubusercontent.com/oyvinrog/SQLShell/main/assets/images/sqlshell_demo.png" alt="SQLShell Interface" width="80%" height="auto">
44
+
45
+ </div>
46
+
47
+ ## 🚀 Key Features
48
+
49
+ - **Interactive SQL Interface** - Rich syntax highlighting for enhanced query writing
50
+ - **Context-Aware Suggestions** - Intelligent SQL autocompletion based on query context and schema
51
+ - **DuckDB Integration** - Powerful analytical queries powered by DuckDB
52
+ - **Multi-Format Support** - Import and query Excel (.xlsx, .xls), CSV, and Parquet files effortlessly
53
+ - **Modern UI** - Clean, tabular results display with intuitive controls
54
+ - **Table Preview** - Quick view of imported data tables
55
+ - **Test Data Generation** - Built-in sample data for testing and learning
56
+ - **Multiple Views** - Support for multiple concurrent table views
57
+ - **Productivity Tools** - Streamlined workflow with F5/F9 shortcuts and Ctrl+Enter for query execution
58
+ - **Explain Column** - Analyze relationships between data columns directly from query results
59
+
60
+ ## ⚡ F5/F9 Quick Execution
61
+
62
+ SQLShell includes powerful keyboard shortcuts for efficient SQL execution:
63
+
64
+ - **F5**: Execute all SQL statements in the editor sequentially
65
+ - **F9**: Execute only the current SQL statement (where your cursor is positioned)
66
+
67
+ This allows for rapid testing and development - place your cursor in any statement and press F9 to execute just that query, or press F5 to run everything.
68
+
69
+ ## 📦 Installation
70
+
71
+ ### Using pip (Recommended)
72
+
73
+ ```bash
74
+ pip install sqlshell
75
+ ```
76
+
77
+ ### Linux Setup with Virtual Environment
78
+
79
+ ```bash
80
+ # Create and activate virtual environment
81
+ python3 -m venv ~/.venv/sqlshell
82
+ source ~/.venv/sqlshell/bin/activate
83
+
84
+ # Install SQLShell
85
+ pip install sqlshell
86
+
87
+ # Configure shell alias
88
+ echo 'alias sqls="~/.venv/sqlshell/bin/sqls"' >> ~/.bashrc # or ~/.zshrc for Zsh
89
+ source ~/.bashrc # or source ~/.zshrc
90
+ ```
91
+
92
+ ### Development Installation
93
+
94
+ ```bash
95
+ git clone https://github.com/oyvinrog/SQLShell.git
96
+ cd SQLShell
97
+ pip install -e .
98
+ ```
99
+
100
+ ## 🎯 Getting Started
101
+
102
+ 1. **Launch the Application**
103
+ ```bash
104
+ sqls
105
+ ```
106
+
107
+ If the `sqls` command doesn't work (e.g., "access denied" on Windows), you can use this alternative:
108
+ ```bash
109
+ python -c "import sqlshell; sqlshell.start()"
110
+ ```
111
+
112
+ 2. **Database Connection**
113
+ - SQLShell automatically connects to a local DuckDB database named 'pool.db'
114
+
115
+ 3. **Working with Data Files**
116
+ - Click "Load Files" to select your Excel, CSV, or Parquet files
117
+ - File contents are loaded as queryable SQL tables
118
+ - Query using standard SQL syntax
119
+
120
+ 4. **Query Execution**
121
+ - Enter SQL in the editor
122
+ - Execute using Ctrl+Enter or the "Execute" button
123
+ - View results in the structured output panel
124
+
125
+ 5. **Test Data**
126
+ - Load sample test data using the "Test" button for quick experimentation
127
+
128
+ 6. **Using Context-Aware Suggestions**
129
+ - Press Ctrl+Space to manually trigger suggestions
130
+ - Suggestions appear automatically as you type
131
+ - Context-specific suggestions based on your query position:
132
+ - After SELECT: columns and functions
133
+ - After FROM/JOIN: tables with join conditions
134
+ - After WHERE: columns with appropriate operators
135
+ - Inside functions: relevant column suggestions
136
+
137
+ 7. **Column Analysis**
138
+ - Right-click on column headers in the results pane
139
+ - Access features like sorting, filtering, and the "Explain Column" analysis tool
140
+
141
+ ## 📝 Query Examples
142
+
143
+ ### Basic Join Operation
144
+ ```sql
145
+ SELECT *
146
+ FROM sample_sales_data cd
147
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid
148
+ LIMIT 3;
149
+ ```
150
+
151
+ ### Multi-Statement Queries
152
+ ```sql
153
+ -- Create a temporary view
154
+ CREATE OR REPLACE TEMPORARY VIEW test_v AS
155
+ SELECT *
156
+ FROM sample_sales_data cd
157
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid;
158
+
159
+ -- Query the view
160
+ SELECT DISTINCT productid
161
+ FROM test_v;
162
+ ```
163
+
164
+ ## 💡 Pro Tips
165
+
166
+ - Use temporary views for complex query organization
167
+ - Leverage keyboard shortcuts for efficient workflow
168
+ - Explore the multi-format support for various data sources
169
+ - Create multiple tabs for parallel query development
170
+ - The context-aware suggestions learn from your query patterns
171
+ - Type `table_name.` to see all columns for a specific table
172
+ - After JOIN keyword, the system suggests relevant tables and join conditions
173
+
174
+ ## 📊 Table Profiling
175
+
176
+ SQLShell provides powerful table profiling tools to help you understand your data. These tools are accessible from the left-hand side table menu via right-click on any table:
177
+
178
+ <div align="center">
179
+ <img src="https://raw.githubusercontent.com/oyvinrog/SQLShell/main/assets/images/column_profiler.png" alt="Column Profiler" width="80%" height="auto">
180
+ </div>
181
+
182
+ ### Table Profiling Options
183
+
184
+ Right-click on any table in the left panel to access these profiling tools:
185
+
186
+ 1. **Analyze Column Importance**
187
+ - Calculates entropy for each column to identify the most information-rich fields
188
+ - Visualizes column importance with color-coded bars
189
+ - Helps identify which columns are most useful for analysis and modeling
190
+
191
+ 2. **Profile Table Structure**
192
+ - Identifies candidate keys and functional dependencies
193
+ - Discovers potential primary keys and relationships between columns
194
+ - Suggests possible normalized table structures
195
+ - Helps understand table organization and optimize schema design
196
+
197
+ 3. **Analyze Column Distributions**
198
+ - Generates histograms, box plots, and other statistical visualizations
199
+ - Identifies the distribution pattern of each column (normal, uniform, etc.)
200
+ - Provides detailed statistics like min, max, mean, median, skewness
201
+ - Helps identify outliers and understand data patterns
202
+
203
+ 4. **Analyze Foreign Keys** (multi-table selection)
204
+ - Select multiple tables by holding Ctrl or Shift while clicking
205
+ - Right-click to access "Analyze Foreign Keys Between X Tables"
206
+ - Automatically discovers potential foreign key relationships between tables
207
+ - Identifies matching columns that could serve as join conditions
208
+ - Helps understand cross-table relationships in your data model
209
+
210
+ ### Using the Profilers
211
+
212
+ 1. **Access the Profilers**
213
+ - Right-click on any table in the schema browser
214
+ - Select the desired profiling option from the context menu
215
+ - For foreign key analysis, select multiple tables first
216
+
217
+ 2. **Interpret the Results**
218
+ - Each profiler provides interactive visualizations
219
+ - Hover over charts for detailed information
220
+ - Switch between different views using the tabs
221
+ - Sort and filter results to focus on specific columns
222
+
223
+ 3. **Benefits**
224
+ - Quickly understand data composition without writing queries
225
+ - Identify data quality issues and outliers
226
+ - Discover relationships between columns
227
+ - Make informed decisions about query optimization
228
+
229
+ The table profiling tools are invaluable for exploratory data analysis, helping you gain insights before writing complex queries.
230
+
231
+ ## 📊 Column Analysis
232
+
233
+ SQLShell provides powerful tools to analyze individual columns directly from your query results:
234
+
235
+ ### Explain Column Feature
236
+
237
+ The "Explain Column" feature helps you understand the relationships between columns in your query results:
238
+
239
+ 1. **How to Access**:
240
+ - Right-click on any column header in the query results table
241
+ - Select "Explain Column" from the context menu
242
+
243
+ 2. **What It Does**:
244
+ - Analyzes the selected column's relationship with other columns in the result set
245
+ - Identifies correlations and dependencies between columns
246
+ - Provides visualizations to help understand the column's importance and distribution
247
+
248
+ 3. **Benefits**:
249
+ - Quickly identify which columns are most related to your target column
250
+ - Discover hidden patterns and relationships in your data
251
+ - Make data-driven decisions without writing complex analytical queries
252
+
253
+ ### Multivariate Analysis Feature
254
+
255
+ The Column Profiler now offers in-depth multivariate analysis to explore relationships between columns:
256
+
257
+ 1. **How to Access**:
258
+ - In the Column Profiler, double-click on any feature in the importance table
259
+ - A detailed visualization window will appear showing the relationship between the selected feature and the target column
260
+
261
+ 2. **Smart Visualizations**:
262
+ - Automatically selects the most appropriate visualization based on data types:
263
+ - **Numeric vs. Numeric**: Scatter plot with regression line
264
+ - **Categorical vs. Numeric**: Bar chart showing average values
265
+ - **Numeric vs. Categorical**: Box plot showing distribution
266
+ - **Categorical vs. Categorical**: Heatmap showing relationship strength
267
+
268
+ 3. **Benefits**:
269
+ - Gain deeper insights into how features relate to your target variable
270
+ - Understand which features have strong predictive relationships
271
+ - Identify patterns and outliers in multivariate relationships
272
+ - Make better decisions about feature selection for analysis and modeling
273
+
274
+ This feature is particularly useful for data scientists and analysts who need to understand variable relationships quickly without writing complex correlation queries.
275
+
276
+ ### One-hot encoding
277
+
278
+ If you are working with text (i.e. job description or job title to analyze salary), you would want to
279
+ do 'one-hot encoding'.
280
+
281
+ 1. **How to Access**:
282
+ - Right-click on any column header in the query results table
283
+ - Select "Encode text" from the context menu
284
+
285
+ <div align="center">
286
+ <img src="https://raw.githubusercontent.com/oyvinrog/SQLShell/main/assets/images/column_encoding.png" alt="Column Profiler" width="80%" height="auto">
287
+ </div>
288
+
289
+ 2. **How It Works**:
290
+ - SQLShell tokenizes the text into meaningful words and phrases
291
+ - Each unique token becomes a new binary feature (1 if present, 0 if absent)
292
+ - The system applies intelligent filtering to remove common words with low information value
293
+ - Results appear as a new query with encoded columns automatically added
294
+
295
+ <!-- Screenshot 2: Encoding process/dialog showing options -->
296
+
297
+ 3. **Applications**:
298
+ - Analyze how specific keywords in job descriptions correlate with salary levels
299
+ - Identify which terms in product descriptions drive higher sales
300
+ - Extract features from unstructured text for further analysis
301
+ - Prepare text data for statistical modeling and machine learning
302
+
303
+ 4. **Using the Encoded Data**:
304
+ - After encoding, SQLShell presents a visualization showing top correlations
305
+ - Sort encoded features by correlation strength to identify key terms
306
+ - Use encoded columns in subsequent queries for deeper analysis
307
+ - Join encoded results with other tables for cross-dataset insights
308
+
309
+ <!-- Screenshot 3: Results showing correlation between job descriptions and salary -->
310
+
311
+ 5. **Benefits**:
312
+ - Transform unstructured text into structured, analyzable data
313
+ - Discover hidden patterns between text content and numerical outcomes
314
+ - Identify specific terms that have the strongest relationship with target variables
315
+ - Perform advanced text analysis without specialized NLP knowledge
316
+
317
+ This feature is particularly powerful for HR analytics, marketing text analysis, and any scenario where you need to extract insights from unstructured text data.
318
+
319
+ ## 📋 Requirements
320
+
321
+ - Python 3.8 or higher
322
+ - Dependencies (automatically installed):
323
+ - PyQt6 ≥ 6.4.0
324
+ - DuckDB ≥ 0.9.0
325
+ - Pandas ≥ 2.0.0
326
+ - NumPy ≥ 1.24.0
327
+ - openpyxl ≥ 3.1.0 (Excel support)
328
+ - pyarrow ≥ 14.0.1 (Parquet support)
329
+ - fastparquet ≥ 2023.10.1 (Alternative parquet engine)
330
+ - xlrd ≥ 2.0.1 (Support for older .xls files)
331
+
332
+ ## 📄 License
333
+
334
+ This project is licensed under the MIT License - see the LICENSE file for details.
335
+
336
+ ## 📁 Project Structure
337
+
338
+ ```
339
+ SQLShell/
340
+ ├── sqlshell/ # Main package
341
+ │ ├── __init__.py
342
+ │ ├── main.py # Main application entry point
343
+ │ ├── execution_handler.py # F5/F9 SQL execution functionality
344
+ │ ├── editor_integration.py # Editor integration utilities
345
+ │ ├── query_tab.py # Query tab implementation
346
+ │ ├── splash_screen.py # Application splash screen
347
+ │ └── styles.py # UI styling
348
+ ├── tests/ # Test files
349
+ │ ├── f5_f9_functionality/ # F5/F9 functionality tests and demos
350
+ │ │ ├── README.md # Documentation for F5/F9 tests
351
+ │ │ ├── test_execution_handler.py # Comprehensive test suite
352
+ │ │ └── demo_f5_f9.py # Interactive demo
353
+ │ └── test_query_executor.py # Other test files
354
+ ├── docs/ # Documentation
355
+ │ ├── F5_F9_FUNCTIONALITY.md # Detailed F5/F9 documentation
356
+ │ └── IMPLEMENTATION_SUMMARY.md # Implementation details
357
+ ├── assets/ # Assets and resources
358
+ │ └── images/ # Images and screenshots
359
+ │ ├── sqlshell_logo.png
360
+ │ ├── sqlshell_demo.png
361
+ │ ├── column_profiler.png
362
+ │ └── column_encoding.png
363
+ ├── sample_data/ # Sample data files
364
+ │ ├── test_*.csv # Test CSV files
365
+ │ ├── california_housing_data.parquet
366
+ │ └── pool.db # Sample database
367
+ ├── main.py # Application launcher
368
+ ├── run.py # Alternative launcher
369
+ ├── README.md # This file
370
+ ├── requirements.txt # Python dependencies
371
+ ├── pyproject.toml # Project configuration
372
+ └── MANIFEST.in # Package manifest
373
+ ```
374
+
375
+ ## 🧪 Testing
376
+
377
+ The project includes comprehensive tests for the F5/F9 functionality:
378
+
379
+ ```bash
380
+ # Run the interactive test suite
381
+ cd tests/f5_f9_functionality
382
+ python test_execution_handler.py
383
+
384
+ # Try the interactive demo
385
+ python demo_f5_f9.py
386
+ ```
387
+
388
+ For complete documentation on F5/F9 functionality, see `docs/F5_F9_FUNCTIONALITY.md`.
389
+
390
+ ## 🤝 Contributing
391
+
392
+ 1. Fork the repository
393
+ 2. Create a feature branch
394
+ 3. Make your changes
395
+ 4. Add tests if applicable
396
+ 5. Submit a pull request
397
+
398
+ ## 📄 License
399
+
400
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -1,22 +1,25 @@
1
1
  sqlshell/LICENSE,sha256=YFVzvqHDVzBVtEZoKwcHhashVdNy4P7tDEQ561jAdyo,1070
2
2
  sqlshell/MANIFEST.in,sha256=UautKSW4Kzjsy1Ti05-P58qRgM4ct4mmG3aserBGaX0,144
3
- sqlshell/README.md,sha256=UoWQzdsYThrOoajT40iOtpI73g5ANB7w12vll0eH0Ck,1357
4
- sqlshell/__init__.py,sha256=b6LUBF2u6U5_gyecqlSyGG4dww9-MxdgP5ThYlTyN7g,263
3
+ sqlshell/README.md,sha256=_FPMDx0xcXt00Qpodw3JwwNeptE2qT0LUBCdNhEtRsA,1739
4
+ sqlshell/__init__.py,sha256=dCODXgb9N7uXAJ_m7E_HlzZC69WSY7eikF6ABOG1Uhc,1439
5
5
  sqlshell/context_suggester.py,sha256=OdfSBqwKWtf6yGj-_cNjf9RZG9cc70TWZ_7ieAVKJqk,33970
6
- sqlshell/create_test_data.py,sha256=uJSFyqm8zYWpyERPd29iMu-EbtvKiwK5WV0N-LibNOc,5385
6
+ sqlshell/create_test_data.py,sha256=3LzUEbAn7cNgahuivXB7XTnb3osE-n-VPJeoaFBP8tE,6595
7
7
  sqlshell/editor.py,sha256=iWSYUtsNCud7HWZrcqD9Ef7FEa0nt7ekeUHV6CmCgao,39635
8
- sqlshell/main.py,sha256=vt7s6dXmY6iw-Y3jr2YtPNMwwvdqPu1zqNRNidtIRN0,150575
8
+ sqlshell/editor_integration.py,sha256=sZSSwd0vsuV2qlRG1IUlw67y7902Hm75U63YbjKvmWo,4531
9
+ sqlshell/execution_handler.py,sha256=7IwVQz1GiMlXERmdP7CNLtH3SPcjzWon_ywi7vpecz0,15466
10
+ sqlshell/main.py,sha256=d6d_wXergwC-Mx50fi4N2rX-ULidAMvP1l9qoQtlueI,183623
9
11
  sqlshell/menus.py,sha256=hiT1CXXnsRKkai7oJlPi94du_GKtIhl5X5LOGvqcOqs,5684
10
- sqlshell/query_tab.py,sha256=9Yu_7MRikZXrQ003N2HOvjFEBdiz_J9ZLWgTzXPiumc,8404
12
+ sqlshell/query_tab.py,sha256=CjY1B4V7aY0wrFncOevzWWb3G-d_Cl5fgeTD9NG4de8,36820
11
13
  sqlshell/splash_screen.py,sha256=K0Ku_nXJWmWSnVEh2OttIthRZcnUoY_tmjIAWIWLm7Y,17604
12
14
  sqlshell/sqlshell_demo.png,sha256=dPp9J1FVqQVfrh-gekosuha2Jw2p2--wxbOmt2kr7fg,133550
13
15
  sqlshell/styles.py,sha256=EGA_Ow-XerPEQgj82ts3fnqkEPMcjSlJPblbPu9L__s,7135
14
16
  sqlshell/suggester_integration.py,sha256=w3fKuSq5ex5OHxSBzZunyq3mbGvX06-7nxgLClnK5Kw,13232
15
17
  sqlshell/syntax_highlighter.py,sha256=mPwsD8N4XzAUx0IgwlelyfjUhe0xmH0Ug3UI9hTcHz0,5861
16
- sqlshell/table_list.py,sha256=ET9UGxhRL2j42GC6WqocotvQIOUzRskH9BnmciVX_As,37670
18
+ sqlshell/table_list.py,sha256=0V2vQXjah8uWdRaRcB0w9WzclaFX5HulCUmmJEjUW8k,41585
17
19
  sqlshell/data/create_test_data.py,sha256=sUTcf50V8-bVwYV2VNTLK65c-iHiU4wb99By67I10zM,5404
18
- sqlshell/db/__init__.py,sha256=AJGRkywFCnJliwfOBvtE_ISXjdESkRea7lBFM5KjuTU,152
19
- sqlshell/db/database_manager.py,sha256=DRPoRYgY9DthD1YvLuMeo-aRfaAAcdAKZKXMPDmAcsg,35722
20
+ sqlshell/db/__init__.py,sha256=ww-pZ0_ucFwXpR5KkkLI-heV06tU7FrO6TwuYaCuTKQ,222
21
+ sqlshell/db/database_manager.py,sha256=RiJB42j0TJJocnHP8hvWXuSPqBYLBpg_9hazEcgHifg,52779
22
+ sqlshell/db/export_manager.py,sha256=PpukqPZy68AMR6ds0o9cRK3r_zdBdP-M44neerIbwMs,7295
20
23
  sqlshell/resources/__init__.py,sha256=VLTJ_5pUHhctRiV8UZDvG-jnsjgT6JQvW-ZPzIJqBIY,44
21
24
  sqlshell/resources/create_icon.py,sha256=O7idVEKwmSXxLUsbeRn6zcYVQLPSdJi98nGamTgXiM4,4905
22
25
  sqlshell/resources/create_splash.py,sha256=t1KK43Y0pHKGcdRkbnZgV6_y1c1C0THHQl5_fmpC2gQ,3347
@@ -30,12 +33,16 @@ sqlshell/sqlshell/create_test_data.py,sha256=TFXgWeK1l3l_c4Dg38yS8Df4sBUfOZcBucX
30
33
  sqlshell/sqlshell/create_test_databases.py,sha256=oqryFJJahqLFsAjBFM4r9Fe1ea7djDcRpT9U_aBf7PU,3573
31
34
  sqlshell/ui/__init__.py,sha256=2CsTDAvRZJ99gkjs3-rdwkxyGVAKXX6ueOhPdP1VXQc,206
32
35
  sqlshell/ui/bar_chart_delegate.py,sha256=tbtIt2ZqPIcYWNJzpONpYa0CYURkLdjkg23TI7TmOKY,1881
33
- sqlshell/ui/filter_header.py,sha256=c4Mg1J1yTUfrnT9C-xDWHhcauRsgU3WNfvVInv1J814,16074
36
+ sqlshell/ui/filter_header.py,sha256=s2PfqVTCrQjNOtTYfiR50HL6PIVwlL5kF7lO4PGPTko,18196
34
37
  sqlshell/utils/__init__.py,sha256=iPKvOsKcfnV7xvhQVOz8BiQ4kbFZ7PGUW8vg0vyMqvk,225
38
+ sqlshell/utils/profile_column.py,sha256=QlnjyzFMUNHAKuggMYED0LkDs6BxWe9CnsLEr4rtEWE,113425
39
+ sqlshell/utils/profile_distributions.py,sha256=1AcgubrouKYCiVoXtYz6RVX8kXSp6VaoEoJInXMU0RU,25379
35
40
  sqlshell/utils/profile_entropy.py,sha256=pJTcXlBkSEPzL3Fvxizf5gBkw6IsUjfa9Y6MjAqF1do,13238
41
+ sqlshell/utils/profile_foreign_keys.py,sha256=kF4PeJLHXjVPpnLhM7ERlm3Z3r75QgX6a9gpMNWlgjA,23227
36
42
  sqlshell/utils/profile_keys.py,sha256=ajdBTqvZVmAlVaY-kDmv_D8D3sKASG75PLTzf8Y8nX4,14170
37
- sqlshell-0.2.2.dist-info/METADATA,sha256=CL9bP1ILqQPtblWIoEKxfAbxfIGFvPF4ZEAj1c5Xrws,6101
38
- sqlshell-0.2.2.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
39
- sqlshell-0.2.2.dist-info/entry_points.txt,sha256=Kd0fOvyOW7UiTgTVY7abVOmDIH2Y2nawGTp5kVadac4,44
40
- sqlshell-0.2.2.dist-info/top_level.txt,sha256=ahwsMFhvAqI97ZkT2xvHL5iZCO1p13mNiUOFkdSFwms,9
41
- sqlshell-0.2.2.dist-info/RECORD,,
43
+ sqlshell/utils/profile_ohe.py,sha256=yXsYtHnyhtvdBpKvJEqu20e2t4qo0kJE8Rvl0bAogPs,24644
44
+ sqlshell-0.3.0.dist-info/METADATA,sha256=IPsuPMIwGVLLGTGpFo2334uUHhZrWxJIpAOsC1-KAdc,15362
45
+ sqlshell-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ sqlshell-0.3.0.dist-info/entry_points.txt,sha256=Kd0fOvyOW7UiTgTVY7abVOmDIH2Y2nawGTp5kVadac4,44
47
+ sqlshell-0.3.0.dist-info/top_level.txt,sha256=ahwsMFhvAqI97ZkT2xvHL5iZCO1p13mNiUOFkdSFwms,9
48
+ sqlshell-0.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,198 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: sqlshell
3
- Version: 0.2.2
4
- Summary: A powerful SQL shell with GUI interface for data analysis
5
- Author: SQLShell Team
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/oyvinrog/SQLShell
8
- Keywords: sql,data analysis,gui,duckdb
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Requires-Python: >=3.8
17
- Description-Content-Type: text/markdown
18
- Requires-Dist: pandas>=2.0.0
19
- Requires-Dist: numpy>=1.24.0
20
- Requires-Dist: PyQt6>=6.4.0
21
- Requires-Dist: duckdb>=0.9.0
22
- Requires-Dist: openpyxl>=3.1.0
23
- Requires-Dist: pyarrow>=14.0.1
24
- Requires-Dist: fastparquet>=2023.10.1
25
- Requires-Dist: xlrd>=2.0.1
26
- Requires-Dist: deltalake
27
- Requires-Dist: Pillow>=10.0.0
28
-
29
- # SQLShell
30
-
31
- <div align="center">
32
-
33
- <img src="sqlshell_logo.png" alt="SQLShell Logo" width="180" height="auto">
34
-
35
- **A powerful SQL shell with GUI interface for data analysis**
36
-
37
- <img src="sqlshell_demo.png" alt="SQLShell Interface" width="80%" height="auto">
38
-
39
- </div>
40
-
41
- ## 🚀 Key Features
42
-
43
- - **Interactive SQL Interface** - Rich syntax highlighting for enhanced query writing
44
- - **Context-Aware Suggestions** - Intelligent SQL autocompletion based on query context and schema
45
- - **DuckDB Integration** - Powerful analytical queries powered by DuckDB
46
- - **Multi-Format Support** - Import and query Excel (.xlsx, .xls), CSV, and Parquet files effortlessly
47
- - **Modern UI** - Clean, tabular results display with intuitive controls
48
- - **Table Preview** - Quick view of imported data tables
49
- - **Test Data Generation** - Built-in sample data for testing and learning
50
- - **Multiple Views** - Support for multiple concurrent table views
51
- - **Productivity Tools** - Streamlined workflow with keyboard shortcuts (e.g., Ctrl+Enter for query execution)
52
-
53
- ## 📦 Installation
54
-
55
- ### Using pip (Recommended)
56
-
57
- ```bash
58
- pip install sqlshell
59
- ```
60
-
61
- ### Linux Setup with Virtual Environment
62
-
63
- ```bash
64
- # Create and activate virtual environment
65
- python3 -m venv ~/.venv/sqlshell
66
- source ~/.venv/sqlshell/bin/activate
67
-
68
- # Install SQLShell
69
- pip install sqlshell
70
-
71
- # Configure shell alias
72
- echo 'alias sqls="~/.venv/sqlshell/bin/sqls"' >> ~/.bashrc # or ~/.zshrc for Zsh
73
- source ~/.bashrc # or source ~/.zshrc
74
- ```
75
-
76
- ### Development Installation
77
-
78
- ```bash
79
- git clone https://github.com/oyvinrog/SQLShell.git
80
- cd SQLShell
81
- pip install -e .
82
- ```
83
-
84
- ## 🎯 Getting Started
85
-
86
- 1. **Launch the Application**
87
- ```bash
88
- sqls
89
- ```
90
-
91
- If the `sqls` command doesn't work (e.g., "access denied" on Windows), you can use this alternative:
92
- ```bash
93
- python -c "import sqlshell; sqlshell.start()"
94
- ```
95
-
96
- 2. **Database Connection**
97
- - SQLShell automatically connects to a local DuckDB database named 'pool.db'
98
-
99
- 3. **Working with Data Files**
100
- - Click "Load Files" to select your Excel, CSV, or Parquet files
101
- - File contents are loaded as queryable SQL tables
102
- - Query using standard SQL syntax
103
-
104
- 4. **Query Execution**
105
- - Enter SQL in the editor
106
- - Execute using Ctrl+Enter or the "Execute" button
107
- - View results in the structured output panel
108
-
109
- 5. **Test Data**
110
- - Load sample test data using the "Test" button for quick experimentation
111
-
112
- 6. **Using Context-Aware Suggestions**
113
- - Press Ctrl+Space to manually trigger suggestions
114
- - Suggestions appear automatically as you type
115
- - Context-specific suggestions based on your query position:
116
- - After SELECT: columns and functions
117
- - After FROM/JOIN: tables with join conditions
118
- - After WHERE: columns with appropriate operators
119
- - Inside functions: relevant column suggestions
120
-
121
- ## 📝 Query Examples
122
-
123
- ### Basic Join Operation
124
- ```sql
125
- SELECT *
126
- FROM sample_sales_data cd
127
- INNER JOIN product_catalog pc ON pc.productid = cd.productid
128
- LIMIT 3;
129
- ```
130
-
131
- ### Multi-Statement Queries
132
- ```sql
133
- -- Create a temporary view
134
- CREATE OR REPLACE TEMPORARY VIEW test_v AS
135
- SELECT *
136
- FROM sample_sales_data cd
137
- INNER JOIN product_catalog pc ON pc.productid = cd.productid;
138
-
139
- -- Query the view
140
- SELECT DISTINCT productid
141
- FROM test_v;
142
- ```
143
-
144
- ## 💡 Pro Tips
145
-
146
- - Use temporary views for complex query organization
147
- - Leverage keyboard shortcuts for efficient workflow
148
- - Explore the multi-format support for various data sources
149
- - Create multiple tabs for parallel query development
150
- - The context-aware suggestions learn from your query patterns
151
- - Type `table_name.` to see all columns for a specific table
152
- - After JOIN keyword, the system suggests relevant tables and join conditions
153
-
154
- ## 📊 Column Profiler
155
-
156
- The Column Profiler provides quick statistical insights into your table columns:
157
-
158
- <img src="column_profiler.png" alt="Column Profiler" width="80%" height="auto">
159
-
160
- ### Using the Column Profiler
161
-
162
- 1. **Access the Profiler**
163
- - Right-click on any table in the schema browser
164
- - Select "Profile Table" from the context menu
165
-
166
- 2. **View Column Statistics**
167
- - Instantly see key metrics for each column:
168
- - Data type
169
- - Non-null count and percentage
170
- - Unique values count
171
- - Mean, median, min, and max values (for numeric columns)
172
- - Most frequent values and their counts
173
- - Distribution visualization
174
-
175
- 3. **Benefits**
176
- - Quickly understand data distribution
177
- - Identify outliers and data quality issues
178
- - Make informed decisions about query conditions
179
- - Assess column cardinality for join operations
180
-
181
- The Column Profiler is an invaluable tool for exploratory data analysis, helping you gain insights before writing complex queries.
182
-
183
- ## 📋 Requirements
184
-
185
- - Python 3.8 or higher
186
- - Dependencies (automatically installed):
187
- - PyQt6 ≥ 6.4.0
188
- - DuckDB ≥ 0.9.0
189
- - Pandas ≥ 2.0.0
190
- - NumPy ≥ 1.24.0
191
- - openpyxl ≥ 3.1.0 (Excel support)
192
- - pyarrow ≥ 14.0.1 (Parquet support)
193
- - fastparquet ≥ 2023.10.1 (Alternative parquet engine)
194
- - xlrd ≥ 2.0.1 (Support for older .xls files)
195
-
196
- ## 📄 License
197
-
198
- This project is licensed under the MIT License - see the LICENSE file for details.