sqlshell 0.1.6__tar.gz → 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.

Potentially problematic release.


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

Files changed (84) hide show
  1. sqlshell-0.1.9/MANIFEST.in +10 -0
  2. sqlshell-0.1.9/PKG-INFO +122 -0
  3. sqlshell-0.1.9/README.md +93 -0
  4. sqlshell-0.1.9/pool.db +0 -0
  5. {sqlshell-0.1.6 → sqlshell-0.1.9}/pyproject.toml +1 -1
  6. {sqlshell-0.1.6 → sqlshell-0.1.9}/setup.py +10 -3
  7. sqlshell-0.1.9/sqlshell/__init__.py +8 -0
  8. sqlshell-0.1.9/sqlshell/create_test_data.py +50 -0
  9. sqlshell-0.1.9/sqlshell/db/__init__.py +5 -0
  10. sqlshell-0.1.9/sqlshell/db/database_manager.py +691 -0
  11. sqlshell-0.1.9/sqlshell/editor.py +856 -0
  12. sqlshell-0.1.9/sqlshell/main.py +2416 -0
  13. sqlshell-0.1.9/sqlshell/query_tab.py +172 -0
  14. sqlshell-0.1.9/sqlshell/resources/__init__.py +1 -0
  15. sqlshell-0.1.9/sqlshell/resources/create_icon.py +131 -0
  16. sqlshell-0.1.9/sqlshell/resources/create_splash.py +96 -0
  17. sqlshell-0.1.9/sqlshell/resources/icon.png +0 -0
  18. sqlshell-0.1.9/sqlshell/resources/logo_large.png +0 -0
  19. sqlshell-0.1.9/sqlshell/resources/logo_medium.png +0 -0
  20. sqlshell-0.1.9/sqlshell/resources/logo_small.png +0 -0
  21. sqlshell-0.1.9/sqlshell/resources/splash_screen.gif +0 -0
  22. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell/setup.py +1 -1
  23. sqlshell-0.1.9/sqlshell/splash_screen.py +405 -0
  24. sqlshell-0.1.9/sqlshell/sqlshell/create_test_data.py +118 -0
  25. sqlshell-0.1.9/sqlshell/sqlshell_demo.png +0 -0
  26. sqlshell-0.1.9/sqlshell/syntax_highlighter.py +123 -0
  27. sqlshell-0.1.9/sqlshell/ui/__init__.py +6 -0
  28. sqlshell-0.1.9/sqlshell/ui/bar_chart_delegate.py +49 -0
  29. sqlshell-0.1.9/sqlshell/ui/filter_header.py +403 -0
  30. sqlshell-0.1.9/sqlshell.egg-info/PKG-INFO +122 -0
  31. sqlshell-0.1.9/sqlshell.egg-info/SOURCES.txt +76 -0
  32. sqlshell-0.1.9/sqlshell_demo.png +0 -0
  33. sqlshell-0.1.9/sqlshell_logo.png +0 -0
  34. sqlshell-0.1.9/test_data/by_category.parquet +0 -0
  35. sqlshell-0.1.9/test_data/city_coordinates.csv +9 -0
  36. sqlshell-0.1.9/test_data/city_coordinates.parquet +0 -0
  37. sqlshell-0.1.9/test_data/city_coordinates.xlsx +0 -0
  38. sqlshell-0.1.9/test_data/customer_data.csv +101 -0
  39. sqlshell-0.1.9/test_data/customer_data.parquet +0 -0
  40. sqlshell-0.1.9/test_data/customer_data.xlsx +0 -0
  41. sqlshell-0.1.9/test_data/customers_by_country.parquet +0 -0
  42. sqlshell-0.1.9/test_data/delete_me.parquet +0 -0
  43. sqlshell-0.1.9/test_data/joined_test.parquet +0 -0
  44. sqlshell-0.1.9/test_data/price_by_category.parquet +0 -0
  45. sqlshell-0.1.9/test_data/product_catalog.csv +51 -0
  46. sqlshell-0.1.9/test_data/product_catalog.parquet +0 -0
  47. sqlshell-0.1.9/test_data/product_catalog.xlsx +0 -0
  48. sqlshell-0.1.9/test_data/product_categories.csv +81 -0
  49. sqlshell-0.1.9/test_data/product_categories.parquet +0 -0
  50. sqlshell-0.1.9/test_data/product_categories.xlsx +0 -0
  51. sqlshell-0.1.9/test_data/s1.parquet +0 -0
  52. sqlshell-0.1.9/test_data/sample_sales_data.csv +1001 -0
  53. sqlshell-0.1.9/test_data/sample_sales_data.parquet +0 -0
  54. sqlshell-0.1.9/test_data/sample_sales_data.xlsx +0 -0
  55. sqlshell-0.1.9/test_data/stock_data.csv +101 -0
  56. sqlshell-0.1.9/test_data/stock_data.parquet +0 -0
  57. sqlshell-0.1.9/test_data/stock_data.xlsx +0 -0
  58. sqlshell-0.1.9/test_data/test.db +0 -0
  59. sqlshell-0.1.9/test_data/test.duckdb +0 -0
  60. sqlshell-0.1.9/test_data/test2.parquet +0 -0
  61. sqlshell-0.1.9/test_data/test3.parquet +0 -0
  62. sqlshell-0.1.9/test_data/test3.xlsx +0 -0
  63. sqlshell-0.1.9/test_data/test4.xlsx +0 -0
  64. sqlshell-0.1.9/test_data/test5.xlsx +0 -0
  65. sqlshell-0.1.9/test_data/testproject.sqls +139 -0
  66. sqlshell-0.1.9/test_data/vaaaa.xlsx +0 -0
  67. sqlshell-0.1.9/test_data/weather_measurements.csv +366 -0
  68. sqlshell-0.1.9/test_data/weather_measurements.parquet +0 -0
  69. sqlshell-0.1.9/test_data/weather_measurements.xlsx +0 -0
  70. sqlshell-0.1.9/test_data/yo.parquet +0 -0
  71. sqlshell-0.1.6/PKG-INFO +0 -92
  72. sqlshell-0.1.6/README.md +0 -63
  73. sqlshell-0.1.6/sqlshell/__init__.py +0 -6
  74. sqlshell-0.1.6/sqlshell/main.py +0 -1473
  75. sqlshell-0.1.6/sqlshell.egg-info/PKG-INFO +0 -92
  76. sqlshell-0.1.6/sqlshell.egg-info/SOURCES.txt +0 -15
  77. {sqlshell-0.1.6 → sqlshell-0.1.9}/setup.cfg +0 -0
  78. {sqlshell-0.1.6/sqlshell/sqlshell → sqlshell-0.1.9/sqlshell/data}/create_test_data.py +0 -0
  79. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell/sqlshell/__init__.py +0 -0
  80. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell/sqlshell/create_test_databases.py +0 -0
  81. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell.egg-info/dependency_links.txt +0 -0
  82. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell.egg-info/entry_points.txt +0 -0
  83. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell.egg-info/requires.txt +0 -0
  84. {sqlshell-0.1.6 → sqlshell-0.1.9}/sqlshell.egg-info/top_level.txt +0 -0
@@ -0,0 +1,10 @@
1
+ include README.md
2
+ include LICENSE
3
+ include sqlshell_logo.png
4
+ include sqlshell_demo.png
5
+ include pool.db
6
+ recursive-include sqlshell/resources *
7
+ recursive-include sqlshell/data *
8
+ recursive-include test_data *
9
+ global-exclude __pycache__
10
+ global-exclude *.py[cod]
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqlshell
3
+ Version: 0.1.9
4
+ Summary: A powerful SQL shell with GUI interface for data analysis
5
+ Home-page: https://github.com/yourusername/sqlshell
6
+ Author: SQLShell Team
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/oyvinrog/SQLShell
9
+ Keywords: sql,data analysis,gui,duckdb
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: pandas>=2.0.0
20
+ Requires-Dist: numpy>=1.24.0
21
+ Requires-Dist: PyQt6>=6.4.0
22
+ Requires-Dist: duckdb>=0.9.0
23
+ Requires-Dist: openpyxl>=3.1.0
24
+ Requires-Dist: pyarrow>=14.0.1
25
+ Requires-Dist: fastparquet>=2023.10.1
26
+ Requires-Dist: xlrd>=2.0.1
27
+ Dynamic: home-page
28
+ Dynamic: requires-python
29
+
30
+ # SQLShell
31
+
32
+ <div align="center">
33
+
34
+ <img src="sqlshell_logo.png" alt="SQLShell Logo" width="256" height="256">
35
+
36
+ **A modern SQL REPL interface for seamless querying of Excel, Parquet, and SQLite databases**
37
+
38
+ ![SQLShell Interface](sqlshell_demo.png)
39
+
40
+ </div>
41
+
42
+ ## 🚀 Key Features
43
+
44
+ - **Interactive SQL Interface** - Rich syntax highlighting for enhanced query writing
45
+ - **DuckDB Integration** - Built-in support for local DuckDB database (pool.db)
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
+ - **Productivity Tools** - Streamlined workflow with keyboard shortcuts (e.g., Ctrl+Enter for query execution)
49
+ - **Professional Design** - Human-readable interface with optimized graphics
50
+
51
+ ## 📦 Installation
52
+
53
+ ### Linux Setup with Virtual Environment
54
+
55
+ ```bash
56
+ # Create and activate virtual environment
57
+ python3 -m venv ~/.venv/sqlshell
58
+ source ~/.venv/sqlshell/bin/activate
59
+
60
+ # Install SQLShell
61
+ pip install sqlshell
62
+
63
+ # Configure shell alias
64
+ echo 'alias sqls="~/.venv/sqlshell/bin/sqls"' >> ~/.bashrc # or ~/.zshrc for Zsh
65
+ source ~/.bashrc # or source ~/.zshrc
66
+ ```
67
+
68
+ ### Windows Quick Start
69
+ SQLShell is immediately available via the `sqls` command after installation:
70
+ ```bash
71
+ pip install sqlshell
72
+ ```
73
+
74
+ ## 🎯 Getting Started
75
+
76
+ 1. **Launch the Application**
77
+ ```bash
78
+ sqls
79
+ ```
80
+
81
+ 2. **Database Connection**
82
+ - SQLShell automatically connects to a local DuckDB database named 'pool.db'
83
+
84
+ 3. **Working with Data Files**
85
+ - Click "Load Files" to select your Excel, CSV, or Parquet files
86
+ - File contents are loaded as queryable SQL tables
87
+ - Query using standard SQL syntax
88
+
89
+ 4. **Query Execution**
90
+ - Enter SQL in the editor
91
+ - Execute using Ctrl+Enter or the "Execute" button
92
+ - View results in the structured output panel
93
+
94
+ ## 📝 Query Examples
95
+
96
+ ### Basic Join Operation
97
+ ```sql
98
+ SELECT *
99
+ FROM sample_sales_data cd
100
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid
101
+ LIMIT 3;
102
+ ```
103
+
104
+ ### Multi-Statement Queries
105
+ ```sql
106
+ -- Create a temporary view
107
+ CREATE OR REPLACE TEMPORARY VIEW test_v AS
108
+ SELECT *
109
+ FROM sample_sales_data cd
110
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid;
111
+
112
+ -- Query the view
113
+ SELECT DISTINCT productid
114
+ FROM test_v;
115
+ ```
116
+
117
+ ## 💡 Pro Tips
118
+
119
+ - Use temporary views for complex query organization
120
+ - Leverage keyboard shortcuts for efficient workflow
121
+ - Explore the multi-format support for various data sources
122
+ - Create multiple tabs for parallel query development
@@ -0,0 +1,93 @@
1
+ # SQLShell
2
+
3
+ <div align="center">
4
+
5
+ <img src="sqlshell_logo.png" alt="SQLShell Logo" width="256" height="256">
6
+
7
+ **A modern SQL REPL interface for seamless querying of Excel, Parquet, and SQLite databases**
8
+
9
+ ![SQLShell Interface](sqlshell_demo.png)
10
+
11
+ </div>
12
+
13
+ ## 🚀 Key Features
14
+
15
+ - **Interactive SQL Interface** - Rich syntax highlighting for enhanced query writing
16
+ - **DuckDB Integration** - Built-in support for local DuckDB database (pool.db)
17
+ - **Multi-Format Support** - Import and query Excel (.xlsx, .xls), CSV, and Parquet files effortlessly
18
+ - **Modern UI** - Clean, tabular results display with intuitive controls
19
+ - **Productivity Tools** - Streamlined workflow with keyboard shortcuts (e.g., Ctrl+Enter for query execution)
20
+ - **Professional Design** - Human-readable interface with optimized graphics
21
+
22
+ ## 📦 Installation
23
+
24
+ ### Linux Setup with Virtual Environment
25
+
26
+ ```bash
27
+ # Create and activate virtual environment
28
+ python3 -m venv ~/.venv/sqlshell
29
+ source ~/.venv/sqlshell/bin/activate
30
+
31
+ # Install SQLShell
32
+ pip install sqlshell
33
+
34
+ # Configure shell alias
35
+ echo 'alias sqls="~/.venv/sqlshell/bin/sqls"' >> ~/.bashrc # or ~/.zshrc for Zsh
36
+ source ~/.bashrc # or source ~/.zshrc
37
+ ```
38
+
39
+ ### Windows Quick Start
40
+ SQLShell is immediately available via the `sqls` command after installation:
41
+ ```bash
42
+ pip install sqlshell
43
+ ```
44
+
45
+ ## 🎯 Getting Started
46
+
47
+ 1. **Launch the Application**
48
+ ```bash
49
+ sqls
50
+ ```
51
+
52
+ 2. **Database Connection**
53
+ - SQLShell automatically connects to a local DuckDB database named 'pool.db'
54
+
55
+ 3. **Working with Data Files**
56
+ - Click "Load Files" to select your Excel, CSV, or Parquet files
57
+ - File contents are loaded as queryable SQL tables
58
+ - Query using standard SQL syntax
59
+
60
+ 4. **Query Execution**
61
+ - Enter SQL in the editor
62
+ - Execute using Ctrl+Enter or the "Execute" button
63
+ - View results in the structured output panel
64
+
65
+ ## 📝 Query Examples
66
+
67
+ ### Basic Join Operation
68
+ ```sql
69
+ SELECT *
70
+ FROM sample_sales_data cd
71
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid
72
+ LIMIT 3;
73
+ ```
74
+
75
+ ### Multi-Statement Queries
76
+ ```sql
77
+ -- Create a temporary view
78
+ CREATE OR REPLACE TEMPORARY VIEW test_v AS
79
+ SELECT *
80
+ FROM sample_sales_data cd
81
+ INNER JOIN product_catalog pc ON pc.productid = cd.productid;
82
+
83
+ -- Query the view
84
+ SELECT DISTINCT productid
85
+ FROM test_v;
86
+ ```
87
+
88
+ ## 💡 Pro Tips
89
+
90
+ - Use temporary views for complex query organization
91
+ - Leverage keyboard shortcuts for efficient workflow
92
+ - Explore the multi-format support for various data sources
93
+ - Create multiple tabs for parallel query development
sqlshell-0.1.9/pool.db ADDED
Binary file
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sqlshell"
7
- version = "0.1.6"
7
+ version = "0.1.9"
8
8
  description = "A powerful SQL shell with GUI interface for data analysis"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import os
3
3
 
4
4
  # Read version from __init__.py
5
- with open(os.path.join('sqlshell', '__init__.py'), 'r') as f:
5
+ with open(os.path.join('sqlshell', '__init__.py'), 'r', encoding='utf-8') as f:
6
6
  for line in f:
7
7
  if line.startswith('__version__'):
8
8
  version = line.split('=')[1].strip().strip('"\'')
@@ -29,7 +29,7 @@ setup(
29
29
  },
30
30
  author="SQLShell Team",
31
31
  description="A powerful SQL shell with GUI interface for data analysis",
32
- long_description=open('README.md').read(),
32
+ long_description=open('README.md', encoding='utf-8').read(),
33
33
  long_description_content_type="text/markdown",
34
34
  keywords="sql, data analysis, gui, duckdb",
35
35
  url="https://github.com/yourusername/sqlshell",
@@ -45,6 +45,13 @@ setup(
45
45
  python_requires=">=3.8",
46
46
  include_package_data=True,
47
47
  package_data={
48
- 'sqlshell': ['*.db'],
48
+ 'sqlshell': [
49
+ '*.db',
50
+ 'resources/*',
51
+ 'data/*',
52
+ 'test_data/*',
53
+ '*.png',
54
+ '*.ico'
55
+ ],
49
56
  },
50
57
  )
@@ -0,0 +1,8 @@
1
+ """
2
+ SQLShell - A powerful SQL shell with GUI interface for data analysis
3
+ """
4
+
5
+ __version__ = "0.1.9"
6
+ __author__ = "SQLShell Team"
7
+
8
+ # SQLShell package initialization
@@ -0,0 +1,50 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+ from datetime import datetime, timedelta
4
+
5
+ def create_sales_data(num_records=1000):
6
+ """Create sample sales data"""
7
+ # Generate random dates within the last year
8
+ end_date = datetime.now()
9
+ start_date = end_date - timedelta(days=365)
10
+ dates = pd.date_range(start=start_date, end=end_date, periods=num_records)
11
+
12
+ # Generate random data
13
+ data = {
14
+ 'orderid': range(1, num_records + 1),
15
+ 'orderdate': dates,
16
+ 'customerid': np.random.randint(1, 101, num_records),
17
+ 'productid': np.random.randint(1, 51, num_records),
18
+ 'quantity': np.random.randint(1, 11, num_records),
19
+ 'unitprice': np.random.uniform(10.0, 1000.0, num_records).round(2)
20
+ }
21
+
22
+ return pd.DataFrame(data)
23
+
24
+ def create_customer_data(num_customers=100):
25
+ """Create sample customer data"""
26
+ # Generate random customer data
27
+ data = {
28
+ 'customerid': range(1, num_customers + 1),
29
+ 'customername': [f"Customer {i}" for i in range(1, num_customers + 1)],
30
+ 'email': [f"customer{i}@example.com" for i in range(1, num_customers + 1)],
31
+ 'country': np.random.choice(['USA', 'UK', 'Canada', 'Australia', 'Germany'], num_customers),
32
+ 'joindate': pd.date_range(start='2020-01-01', periods=num_customers).tolist()
33
+ }
34
+
35
+ return pd.DataFrame(data)
36
+
37
+ def create_product_data(num_products=50):
38
+ """Create sample product data"""
39
+ categories = ['Electronics', 'Books', 'Clothing', 'Home & Garden', 'Sports']
40
+
41
+ # Generate random product data
42
+ data = {
43
+ 'productid': range(1, num_products + 1),
44
+ 'productname': [f"Product {i}" for i in range(1, num_products + 1)],
45
+ 'category': np.random.choice(categories, num_products),
46
+ 'baseprice': np.random.uniform(5.0, 500.0, num_products).round(2),
47
+ 'instock': np.random.choice([True, False], num_products, p=[0.8, 0.2])
48
+ }
49
+
50
+ return pd.DataFrame(data)
@@ -0,0 +1,5 @@
1
+ """Database management components for SQLShell application."""
2
+
3
+ from sqlshell.db.database_manager import DatabaseManager
4
+
5
+ __all__ = ['DatabaseManager']