pymysql-terminal
Lightweight wrapper around PyMySQL for executing queries and displaying results in the terminal.
Install
pip install pymysql-term
from source:
pip install git+https://github.com/pymysql-term/pymysql-term.git
Usage
from pymysql_terminal import Connection, Executor
conn = Connection(host="localhost", database="mydb", user="root", password="root")
ex = Executor(conn)
# print query result as a table
ex.print_table("SELECT * FROM products WHERE discount > %s", (10,))
# fetch as list of dicts
rows = ex.fetch("SELECT * FROM orders")
# insert / update / delete
ex.execute("UPDATE products SET price = %s WHERE product_id = %s", (999.0, 1))
conn.close()
API
Connection(host, database, user, password, port, charset)
Connects to MySQL. Supports auto-reconnect.
Executor(connection)
fetch(sql, params)→list[dict]fetch_one(sql, params)→dictexecute(sql, params)— INSERT / UPDATE / DELETEprint_table(sql, params)— prints formatted table to terminal
Formatter
print_table(rows)— print list of dicts as ASCII tableto_csv(rows, delimiter)→str
Metadata
Release files for pymysql-term 5.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymysql_term-5.0.0.tar.gz | 133.4 kB | Without provenance | Details for pymysql_term-5.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymysql_term-5.0.0-py3-none-any.whl | Python 3 | none | any | Details for pymysql_term-5.0.0-py3-none-any.whl |
Total release size: 293.6 kB
Release files / pymysql_term-5.0.0.tar.gz
| Download URL | pymysql_term-5.0.0.tar.gz |
|---|---|
| Size | 133.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a43c4a0952f464cbc3034116f330f0262c292832750d0762e5d3ec96abed2e97
|
|
BLAKE2b-256 checksum How to use checksums |
dcc87c024738c1e772d3b3d93501d1c2482054869c26b5e7313ffb7fd721b9ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / pymysql_term-5.0.0-py3-none-any.whl
| Download URL | pymysql_term-5.0.0-py3-none-any.whl |
|---|---|
| Size | 160.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c9b5c4d7630903e5fabecfd0490983099408df75e1d4f1f58aa067b66641130
|
|
BLAKE2b-256 checksum How to use checksums |
9b2618b21d68bf7abf3001b21ee00a6b308f70182773e00a2e0d3f5ebce88211
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for pymysql-term 5.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.