Skip to main content

🐍 PY DBMS

A Modern, Secure, and Blazing Fast MySQL CLI Client for Python

PyPI version Python 3.10+ License


PY DBMS is a modern, developer-focused command-line client constructed entirely in Python. It's built for developers who live in the terminal but want a more structured, responsive, and secure experience than the default MySQL CLI provides.

With built-in secure local user profiles, deep UX polish (think execution spinners and MySQL-like multi-line formatting), and a first-class data export system, PY DBMS stands on its own as a premium database interaction layer.


✨ Features

🛡️ Secure Local Profiles (profile_auth.py)

  • Startup Gate: You must log in via a local profile before PY DBMS spins up a MySQL connection.
  • Argon2 Hashed: Your local password is never stored in plaintext (profile.json relies purely on argon2-cffi hashed payloads).
  • Masked Prompts: pwinput safely hides your credentials as you type.

🎨 Stunning Terminal UX

  • Live Query Spinners: Executing a massive JOIN? A sleek cyan spinner ensures you know the query is actively running in the background.
  • MySQL-Style Query Loops: Type complex multi-line queries with ease natively formatted with -> line breaks.
  • Color-Coded Statuses: All terminal errors log instantly with explicit visual warnings like pydbms warning> or mysql error>.

📤 Native Query Exports

  • Export to .csv or .json instantly by appending --export <format> to any query.
  • Completely crash-safe: Unresolved paths or permission errors fall back to clear UI warnings without dropping your session.
  • Handles massive exports securely.

🛠️ Tiered Configuration

  • Global Config (config.json): Set persistent states mapped cleanly across sessions.
  • Session Config (.session-config): Hot-swap settings that reset the moment you exit.
  • Query Overrides (--expand): On-the-fly execution changes explicitly attached to a single inline SQL execution.

🚀 Installation

Prerequisites

  • Python 3.10+
  • A running MySQL Server

Install via pip

pip install -U py-dbms-cli

💻 Quick Start

1. Launch the Environment

pydbms

2. Authentication

On first launch, you'll be prompted to create a secure, hashed local profile. Next time, just log in!

3. Database Connection

You'll instantly be prompted to input your target MySQL Host, Username, and Password. PY DBMS ensures nothing is logged unencrypted to your disk.

4. Write SQL

Write your standard SQL inside the shell:

pydbms> SELECT * FROM users
    -> WHERE id > 100
    -> LIMIT 50;

📖 Helper Meta Commands

PY DBMS includes an array of . prefixed meta-commands that vastly speed up the database inspection process.

Command Description
.help Show all helper commands
.databases List all databases
.tables List tables in the current database
.schema <table> Show the exact CREATE TABLE definition
.clear Clear the terminal screen
.version Show build and MySQL version information
.config Show persistent UI/Export configurations
.config set <section>.<key> <value> Update a config value globally
.config reset <section>.<key> Reset a config value
.session-config Show session-level settings
.session-config set <key> <value> Update a temporary session setting
.exit Safely terminate the CLI and MySQL connection

⚙️ Query Flags

Attach these raw flags to the very end of any valid SQL query.

Flag Description
--expand Render the result set expanded vertically to bypass hard window truncation overrides.
--export <format> [path] Extract your query locally to csv or json.

Example:

SELECT * FROM access_logs WHERE status=404 --expand --export json

🧪 Developer Testing

PY DBMS strictly utilizes pytest to govern all underlying architecture (Query Execution, Parsing, CSV/JSON Export flows, and Configuration Schemas).

All test pipelines are publicly committed to GitHub to ensure community pull requests maintain absolute stability.

To contribute or run tests locally on your machine:

# 1. Install the CLI with developer testing dependencies attached
pip install -e .[dev]

# 2. Run the test suite natively
pytest tests/

👨‍💻 Author

Anish Sethi
B.Tech Computer Science & Engineering
Delhi Technological University (Class of 2029)
LinkedIn | GitHub


📄 License

This project is officially licensed under the BSD 3-Clause License. See the LICENSE file for details or type .version in the terminal for further context.

Metadata

Release files for py-dbms-cli 4.0.100010

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

Source distribution (sdist)

Source distribution for py-dbms-cli 4.0.100010
File Size Uploaded
py_dbms_cli-4.0.100010.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-dbms-cli 4.0.100010
File Interpreter ABI Platform
py_dbms_cli-4.0.100010-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / py_dbms_cli-4.0.100010.tar.gz

Download URL py_dbms_cli-4.0.100010.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
20d75703ad2995ed41393588adaff0aed9f1ea9b090af31a0b6473c9553db5b9
BLAKE2b-256 checksum
How to use checksums
57b2ac142c53125e25bcd559bc06abd2116111d68e23c1eb491e1001343d9578
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / py_dbms_cli-4.0.100010-py3-none-any.whl

Download URL py_dbms_cli-4.0.100010-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7df92af4e473f849bbe7481e9e2d29145f717fbfec54d95ff75cd9f95929d1dc
BLAKE2b-256 checksum
How to use checksums
5d35220ae131346789f96beed753d245e992fc428c57bf263930e6ff1de4dfdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

4.1.0

2 release files

This release

4.0.100010 This release

2 release files

4.0.1

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.0.6

2 release files

3.0.5

1 release file

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.5.0

2 release files

2.1.5

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

3 release files

2.0

2 release files

1.0

2 release files

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