A simple package to make displaying SQL queries much easier
Project description
sqldisplay
An extremely simple package to make displaying SQL queries much easier
How does it work?
It simply takes cursor.description, as well as the query result and turns it into a readable format
How do I use it?
Pretty simple, just install with pip(3):
python3 -m pip install sqldisplay
And then use it! (example)
import mysql.connector
from sqldisplay import sqldisplay
db = mysql.connector.connect(
host="mysql-container",
user="root",
passwd="root",
database="testdb"
)
cursor = db.cursor()
query = "SELECT * FROM Customers WHERE Country = 'USA';"
cursor.execute(query)
result = cursor.fetchall()
sqldisplay.format(cursor.description, result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sqldisplay-1.0.4.tar.gz
(1.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqldisplay-1.0.4.tar.gz.
File metadata
- Download URL: sqldisplay-1.0.4.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17161b25a36f2913f3ca1da1a7971f1ffd133d9e3dc43af7ac9bb4211daa19cd
|
|
| MD5 |
15e4fadb15dd7637e3706150d5e0eb8e
|
|
| BLAKE2b-256 |
9804b5fe684a83bcd2a202553beb24597a393fb8363d63f95813ac1978c0adc3
|
File details
Details for the file sqldisplay-1.0.4-py3-none-any.whl.
File metadata
- Download URL: sqldisplay-1.0.4-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6184db82eb5568d80ac35a8d19b2d53a87e3f1c80628b83224044c26c22920c7
|
|
| MD5 |
45d3b6e05b5396827133825609e8a621
|
|
| BLAKE2b-256 |
5b46b0824ec212d30516e36b9e19ccd30ea4b1d82e90133efad12ed219c0b216
|