Skip to main content

pymysql-terminal

Lightweight wrapper around PyMySQL for executing queries and displaying results in the terminal.

Install

pip install pymysql-terminal

Or from source:

pip install git+https://github.com/amirullahmutalibov/pymysql-terminal.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()

Output example

+------------+--------------+----------+----------+
| product_id | product_name | price    | discount |
+------------+--------------+----------+----------+
| 1          | Nike Zoom    | 1000.00  | 14.0     |
| 2          | Amir Imba    | 984000   | 18.0     |
+------------+--------------+----------+----------+
строк: 2

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) → dict
  • execute(sql, params) — INSERT / UPDATE / DELETE
  • print_table(sql, params) — prints formatted table to terminal

Formatter

  • print_table(rows) — print list of dicts as ASCII table
  • to_csv(rows, delimiter) → str

Metadata

Release files for pymysql-terminal 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymysql-terminal 1.0.0
File Size Uploaded Provenance Actions
pymysql_terminal-1.0.0.tar.gz 3.7 kB Without provenance Details for pymysql_terminal-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymysql-terminal 1.0.0
File Interpreter ABI Platform Actions
pymysql_terminal-1.0.0-py3-none-any.whl Python 3 none any Details for pymysql_terminal-1.0.0-py3-none-any.whl

Total release size: 8.1 kB

Release files / pymysql_terminal-1.0.0.tar.gz

Download URL pymysql_terminal-1.0.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e5fb1845f46e84bae8915ebdcd1eaac361db750ebc5c40d9b2de26016ee7b3cf
BLAKE2b-256 checksum
How to use checksums
b7e6cfb77a271c16bef8adf578042241192ed47b89132e7cf932112bbe3c4a8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pymysql_terminal-1.0.0-py3-none-any.whl

Download URL pymysql_terminal-1.0.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcc8dea20c03615bde245cee4c6df88fbc2d9e91dff963b766c8ecdd374f2063
BLAKE2b-256 checksum
How to use checksums
a286639e421c0ad0e7c6a475a6e2952c27fb768cc48297c8ae5b8d3096d71155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for pymysql-terminal 1.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page