Introduction
DataPyn is a professional IDE designed for data analysts and engineers. It combines SQL and Python in a single unified environment, allowing you to query databases, manipulate data with Pandas, and visualize results - all without switching tools.
With native GitHub Copilot integration, you can chat with AI to generate queries, create visualizations, and automate your data workflow using natural language.
Mixed Code Blocks
Interleave SQL and Python blocks in the same document. SQL results automatically become DataFrames.
Per-Block Connections
Each SQL block can use a different database connection. Query multiple sources in one document.
GitHub Copilot
Chat with AI to create blocks, run queries, and generate visualizations using natural language.
Multiple Sessions
Each tab maintains its own Python namespace and connection. Compare data across environments.
Installation
Windows (Recommended)
Download the MSI installer from the GitHub releases page. No Python installation required.
# Or install from source:
git clone https://github.com/natharuc/datapyn.git
cd datapyn
.\scripts\install.bat
.\scripts\run.bat
Manual Installation
For Linux/macOS or custom setups:
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txt
python source/main.py
First Connection
To start querying data, you need to set up a database connection.
- Click the database icon in the left sidebar or press Ctrl+Shift+C
- Click "New Connection" and fill in your database details
- Click "Test Connection" to verify the settings
- Save and double-click the connection to connect
Once connected, you can start writing SQL queries in any SQL block.
Code Blocks
DataPyn organizes code into blocks. Each block can be SQL or Python, and blocks execute independently or in sequence.
Adding Blocks
- Click + SQL or + Python button
- Use Ctrl+Shift+S for SQL, Ctrl+Shift+P for Python
- Click the language selector to switch an existing block's type
Block Naming
You can name SQL blocks (e.g., "customers"). The result DataFrame will use that name instead of the default "df". This allows you to reference specific query results by name in Python blocks.
-- Block named "customers"
SELECT * FROM customers WHERE active = 1
# In Python, reference by name:
print(customers.head())
Database Support
DataPyn connects to the most popular database systems:
| Database | Features |
|---|---|
| SQL Server | Windows Auth, SQL Auth, dynamic USE database |
| MySQL | Multiple databases, configurable charset |
| PostgreSQL | Schema support, custom types |
| MariaDB | MySQL compatible |
| SQLite | Local file, serverless |
| Databricks | SQL Warehouse, Unity Catalog |
Code Execution
Execute code using keyboard shortcuts or toolbar buttons:
| Shortcut | Action |
|---|---|
| F5 | Execute selection or all blocks |
| Ctrl+F5 | Execute all blocks in sequence |
| Shift+Enter | Execute current block and advance |
Cross-Syntax Execution
SQL results are automatically available in Python as DataFrames:
-- SQL Block
SELECT * FROM sales WHERE year = 2024
# Python Block - df contains SQL result
total = df['amount'].sum()
print(f"Total: ${total:,.2f}")
Visualization
Create charts directly from your data using Matplotlib:
import matplotlib.pyplot as plt
# df is your SQL result
df.plot(kind='bar', x='category', y='revenue')
plt.title('Revenue by Category')
plt.show()
Charts render inline in the results panel. You can also use seaborn, plotly, or any other visualization library.
Import & Export
Drag and Drop Import
Drag files directly into the editor. DataPyn generates import code automatically:
- .csv -
pd.read_csv() - .xlsx -
pd.read_excel() - .json -
pd.read_json() - .dpconn - Connection file auto-import
Export Options
Export your DataFrames or entire workflow:
- Excel/CSV/JSON - Right-click results table
- Python Script - Menu > Export > Python Script (standalone)
- Workspace - Save as .dpw file with all tabs and connections
GitHub Copilot Integration
GitHub Copilot integration requires an active Copilot subscription. DataPyn is free and open source, but Copilot is a paid service from GitHub. You can subscribe at github.com/features/copilot.
DataPyn features deep integration with GitHub Copilot. The AI assistant has full access to your session context - it can see your code, understand your database schema, and take actions like creating blocks, executing queries, and generating visualizations.
Authentication
To use Copilot, you need a GitHub account with Copilot access. On first use, DataPyn will open a browser window for GitHub authentication. Once authorized, you can chat with Copilot directly in the sidebar panel.
Available Models
- GPT-4o - Best for complex analysis
- GPT-4o Mini - Faster, cost-effective
- Claude 3.5 Sonnet - Great for code generation
- o3-mini - Reasoning model
Available Copilot Tools
Copilot has access to specialized tools that let it interact with DataPyn. You don't need to memorize these - just ask naturally and Copilot will use the right tools.
| Tool | Description |
|---|---|
create_block |
Create a new SQL or Python block with code |
edit_block |
Modify code in an existing block |
execute_block |
Run a block and return results |
read_schema |
Read database tables and columns |
get_context |
See current code, connection, and state |
connect_database |
Connect session to a saved connection |
get_variables |
View Python variables in namespace |
write_and_run |
Create, write code, and execute in one action |
Useful Prompts
Here are some example prompts to help you get started with Copilot:
Data Analysis
- "Show me the top 10 customers by revenue"
- "What tables do I have in my database?"
- "Create a monthly sales summary for 2024"
- "Find duplicate records in the orders table"
Visualization
- "Create a bar chart with the results"
- "Plot sales trend over time"
- "Show a pie chart of revenue by region"
- "Create a heatmap of correlations"
Automation
- "Connect to my production database"
- "Export data to Excel"
- "Clean and transform this data"
- "Create a data validation script"
Keyboard Shortcuts
Execution
| F5 | Execute selection or all blocks |
| Ctrl+F5 | Execute all blocks |
| Shift+Enter | Execute and advance |
| Ctrl+Enter | Execute all |
Editing
| Ctrl+D | Duplicate line |
| Ctrl+/ | Toggle comment |
| Ctrl+F | Find |
| Ctrl+H | Find and replace |
| Ctrl+G | Go to line |
Tabs & Sessions
| Ctrl+T | New tab |
| Ctrl+W | Close tab |
| Ctrl+Tab | Next tab |
| Ctrl+1..9 | Go to tab N |
Blocks
| Ctrl+Shift+B | Add new block |
| Alt+Up/Down | Move block |
| Ctrl+Shift+Delete | Delete block |
Frequently Asked Questions
How do I connect to SQL Server with Windows Authentication?
In the connection dialog, select "Windows Auth" as the authentication type. DataPyn will use your current Windows credentials.
Can I use multiple database connections in the same document?
Yes! Each SQL block can have its own connection. Click the connection selector in the block header to choose a different database.
Where are my credentials stored?
Database passwords are encrypted using AES-256 and stored locally in your user profile. They never leave your machine.
How do I access GitHub Copilot?
Click the Copilot icon in the sidebar or press Ctrl+Shift+I. You'll need to authenticate with your GitHub account on first use.
Can I export my work as a Python script?
Yes! Go to Menu > Export > Python Script. DataPyn generates a standalone .py file with all your SQL queries embedded as strings and your Python code ready to run.
DataPyn - MIT License