Skip to main content

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_dbms_cli-4.0.1011.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_dbms_cli-4.0.1011-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file py_dbms_cli-4.0.1011.tar.gz.

File metadata

  • Download URL: py_dbms_cli-4.0.1011.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for py_dbms_cli-4.0.1011.tar.gz
Algorithm Hash digest
SHA256 2776de2714840523c9e8b0ed8471bd41ba4b18964b83d0524c53e32f44786ef6
MD5 8d201e59a7be8c002ec06e58bb25388f
BLAKE2b-256 1f0c6e2cf20d36a926a8c21f37473b15586f0ffa65782e288a14e29c078d77c0

See more details on using hashes here.

File details

Details for the file py_dbms_cli-4.0.1011-py3-none-any.whl.

File metadata

  • Download URL: py_dbms_cli-4.0.1011-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for py_dbms_cli-4.0.1011-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb3b0f01c006eeecf2222f5b31610838a7afd37090f4a426dc1c775bd463973
MD5 7ba9ff879cc16b738a051c1f7071de56
BLAKE2b-256 ac6afaac9798747a7257e99e18375fda8e66bff3c0c59c9cbfe24b7ad7e3a378

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page