pySQLExport-gui is a cross-platform graphical application designed to pull SQL data from MySQL and PostgreSQL databases and export it to various formats including CSV, JSON, HTML, XML, Excel, Parquet, HDF5, and more. Built using PyQt6, it provides an intuitive interface for managing database connections, running queries, and exporting data.
- Cross-Platform: Runs on Windows, macOS, and Linux.
- Database Support: Connects to both MySQL and PostgreSQL databases.
- Data Export: Export query results to multiple formats including CSV, JSON, HTML, XML, Parquet, HDF5, and Excel.
- GUI: Easy-to-use graphical user interface built with PyQt6.
- Data Management: Support for appending data to existing results or replacing them, with options to handle duplicates.
- Python 3.6 or higher
- Pip package manager
pip install pySQLExport-gui
OR
-
Clone the repository:
git clone https://github.com/yourusername/pySQLExport-gui.git cd pySQLExport-gui
-
Install the dependencies:
pip install -r requirements.txt
-
Build the package:
python setup.py sdist bdist_wheel
-
Install the package locally:
pip install .
After installation, you can start the application by running:
```sh
pySQLExport-gui
```
- Database Type: Choose either MySQL or PostgreSQL from the dropdown menu.
- Server: Enter the database server address (e.g.,
localhost
). - Username: Enter the database username.
- Password: Enter the database password.
- Database: Enter the name of the database to connect to.
- Port: The port will automatically update based on the database type selected but can be manually adjusted if needed.
- Establish Connection: Click the
Establish Connection
button to connect to the database.
- SQL Query: Enter your SQL query in the provided text area.
- Execute Query: Click the
Execute Query
button to run the query. Results will be displayed in the table view.
- Export Selection: Select the rows you wish to export, or choose to export all rows.
- Export Format: Choose the desired export format from the options available (CSV, JSON, HTML, XML, Excel, Parquet, HDF5).
- Save File: A file dialog will prompt you to choose the save location.
- Allow Duplicates: Use the checkbox to allow or disallow duplicate rows in your results.
- Open in New Tab: Use the checkbox to open query results in a new tab.
PyQt6
: For the graphical user interface.mysql-connector-python
: To connect to MySQL databases.psycopg2-binary
: To connect to PostgreSQL databases.pandas
: To convert SQL to various data formatsfastparquet
: To convert SQL to Parquetnumpy
: To assist in conversion to HDF5tables
: To assist in export to HDF5
Contributions are welcome! Please fork the repository and submit pull requests for any features, bug fixes, or enhancements.
This project is licensed under the GNU General Public License v3 (GPLv3). See the LICENSE file for more details.
Special thanks to the open-source community for the tools and libraries that make this project possible.