Skip to main content

peepDB

peepDB is an open-source command-line tool and Python library designed for developers and database administrators who need a fast and efficient way to inspect their database tables without writing SQL queries. With support for MySQL, PostgreSQL, MariaDB, MongoDB and SQLite. peepDB is lightweight, secure, and incredibly easy to use.

🚀 Features

  • Multi-Database Support: Works with MySQL, PostgreSQL, MariaDB, MongoDB and SQLite.
  • Quick Data Inspection: View all tables or a specific table with a simple command.
  • User-Friendly CLI: Easy-to-use command-line interface powered by Click.
  • Secure Local Storage: Securely store database connection details with encryption on your local machine.
  • Lightweight: Minimal footprint, designed for speed.
  • Formatted Output: View data in a clean, formatted table or JSON format.
  • Pagination: Efficiently handle large datasets by viewing data in manageable chunks.

🎬 peepDB in Action

Here's a quick demonstration of peepDB:

peepDB Demo

🖼️ peepDB stills

peepDB example 2

Note: The above image reflects the commands used in the official release (v0.1.3)

📦 Installation

You can install peepDB directly from PyPI:

pip install peepdb

🛠️ Usage

peepDB uses a command-based structure for easier and more intuitive use. Here are the main commands with examples:

1. Save Your Database Connection Details

For SQLite:

peepdb save mydb --db-type sqlite --host /path/to/mydb.sqlite --database mydb

For other databases:

peepdb save <connection_name> --db-type [mysql/postgres/mariadb/mongodb] --host <host> --user <user> --password <password> --database <database>

Important Note on Password Handling: The password is required as a command-line argument. While this is convenient for scripting, it's important to note that this method can be insecure as the password may be visible in your command history or to other users who can view your screen or process list.

Example:

peepdb save myapp_db --db-type mysql --host localhost --user root --password my_secure_password --database myapp

For improved security, consider using environment variables or a configuration file to store sensitive information like passwords.

2. List Saved Connections

peepdb list

Example output:

Saved connections:
- myapp_db (mysql)
- analytics_db (postgres)

3. View Tables

View all tables:

peepdb view <connection_name>

View a specific table:

peepdb view <connection_name> --table <table_name>

Example:

peepdb view myapp_db --table users

Output:

Table: users
+----+----------+----------------------+
| id | username |        email         |
+====+==========+======================+
|  1 | johndoe  | johndoe@example.com  |
|  2 | janedoe  | janedoe@example.com  |
+----+----------+----------------------+
Page 1 of 1 (Total rows: 2)

4. Pagination

Use pagination to handle large datasets:

peepdb view <connection_name> --table <table_name> --page <page_number> --page-size <rows_per_page>

Example:

peepdb view myapp_db --table users --page 2 --page-size 50

5. Choose Output Format

Get output in JSON format:

peepdb view <connection_name> --format json

Example:

peepdb view myapp_db --table users --format json

Output:

{
  "users": {
    "data": [
      {"id": 1, "username": "johndoe", "email": "johndoe@example.com"},
      {"id": 2, "username": "janedoe", "email": "janedoe@example.com"}
    ],
    "page": 1,
    "total_pages": 1,
    "total_rows": 2
  }
}

6. Remove Saved Connections

Remove a specific connection:

peepdb remove <connection_name>

Remove all connections:

peepdb remove-all

🔒 Security

peepDB implements several security measures to protect your database connection details:

  1. Local Storage: All connection details are stored locally on your machine, not on any remote servers.
  2. Encryption: Connection details are encrypted before being stored, using the cryptography library.
  3. Caution with Passwords: While passwords are accepted as command-line arguments for convenience, users should be cautious about using this method in shared environments or situations where command history might be accessible to others.

🤝 Contributing

Contributions to peepDB are welcome! Please refer to our Contributing Guide for more information.

📜 License

Distributed under the GNU General Public License Version 3. See the LICENSE file for more details.

📚 Documentation

For more detailed documentation, please visit our GitHub Pages.

Metadata

Release files for peepdb 0.1.4

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

Source distribution (sdist)

Source distribution for peepdb 0.1.4
File Size Uploaded Provenance
peepdb-0.1.4.tar.gz 29.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for peepdb 0.1.4
File Interpreter ABI Platform
peepdb-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 62.1 kB

Release files / peepdb-0.1.4.tar.gz

Download URL peepdb-0.1.4.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
10c8af8b1b552408175d6d163975bb7ed0f54d3d74e3ea29fd45438a07e456f0
BLAKE2b-256 checksum
How to use checksums
1cf3eafe734a2773e687aded557dbd32c06617e7cf324256b0c9e6c1324ad518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / peepdb-0.1.4-py3-none-any.whl

Download URL peepdb-0.1.4-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14e2bd18a04e9aa3f9242ac3329bf31a81de464df72c74c7ce4f86f71754967c
BLAKE2b-256 checksum
How to use checksums
84738ce4e30b42b0acef752a5a14b882da18056dbbc8224cb6b2d9be7383e150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Security for peepdb 0.1.4

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.

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