A modern, secure, aesthetic and your ultimate DBMS client. Implemented as a CLI (Command-Line Interface) tool and written 100% in Python
Project description
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.jsonrelies purely onargon2-cffihashed payloads). - Masked Prompts:
pwinputsafely hides your credentials as you type.
🎨 Stunning Terminal UX
- Live Query Spinners: Executing a massive
JOIN? A sleekcyanspinner 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>ormysql error>.
📤 Native Query Exports
- Export to
.csvor.jsoninstantly 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.
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
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 py_dbms_cli-4.0.1012.tar.gz.
File metadata
- Download URL: py_dbms_cli-4.0.1012.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278f2e8776a3204799e01048f3742e07653b61c8eb106aecbc1720557128c3be
|
|
| MD5 |
5542322b1e84ecd677a6a563fa27207a
|
|
| BLAKE2b-256 |
76ea55efc8087f81ffb95b8238d67c8629d89af352127cf78b712c53cb6d2102
|
File details
Details for the file py_dbms_cli-4.0.1012-py3-none-any.whl.
File metadata
- Download URL: py_dbms_cli-4.0.1012-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99ba679530b00dd75c55db7240c40066e1e1efc249a388bf01b18f2f392e2cbe
|
|
| MD5 |
aeff808a842a355d459a610c3a61e53c
|
|
| BLAKE2b-256 |
e4a50d0d4c972e239e8e3cf82700a39538823ff04c5db3d3ad55f9e0b4ecc52e
|