Skip to main content

A quick database table viewer

Project description

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, and MariaDB, peepDB is lightweight, secure, and incredibly easy to use.

๐Ÿš€ Features

  • Multi-Database Support: Works with MySQL, PostgreSQL, and MariaDB.
  • Quick Data Inspection: View all tables or a specific table with a simple command.
  • User-Friendly CLI: Easy-to-use command-line interface.
  • Secure Storage: Securely store database connection details with encryption.
  • Lightweight: Minimal footprint, designed for speed.
  • Formatted Output: View data in a clean, formatted table or JSON format.

๐Ÿ“ฆ Installation

You can install peepDB directly from PyPI:

pip install peepdb

Requirements:

  • Python 3.6 or higher
  • pip (Python package installer)

Note: If peepdb gives an error like "The term 'peepdb' is not recognized as the name of a cmdlet" remember to add the Python Scripts folder to your PATH in Windows.

Verify the installation by running:

peepdb --version

๐Ÿ› ๏ธ Usage

For Users

1. Save Your Database Connection Details (Optional)

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

2. List Saved Connections

peepdb --list

3. View All Tables or a Specific Table

View all tables:

peepdb <connection_name>

View a specific table:

peepdb <connection_name> --table <table_name>

4. Choose Output Format

Get output in JSON format:

peepdb <connection_name> --format json

5. Remove Saved Connections

Remove a specific connection:

peepdb --remove <connection_name>

Remove all connections:

peepdb --remove-all

Examples

  1. Save MySQL connection details:

    peepdb myapp_db --save --db-type mysql --host localhost --user root --password mypassword --database myapp
    
  2. View all tables in the saved MySQL database:

    peepdb myapp_db
    
  3. View a specific table:

    peepdb myapp_db --table users
    
  4. Get output in JSON format:

    peepdb myapp_db --format json
    

For more detailed usage information, run:

peepdb --help

๐Ÿ‘จโ€๐Ÿ’ป For Developers

Project Structure

peepdb/
โ”œโ”€โ”€ peepdb/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py
โ”‚   โ”œโ”€โ”€ core.py
โ”‚   โ””โ”€โ”€ config.py
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_cli.py
โ”‚   โ”œโ”€โ”€ test_connection.py
โ”‚   โ”œโ”€โ”€ test_data_types.py
โ”‚   โ””โ”€โ”€ test_peepdb.py
โ”œโ”€โ”€ setup.py
โ””โ”€โ”€ pyproject.toml

Setting Up Development Environment

  1. Clone the repository:

    git clone https://github.com/yourusername/peepdb.git
    cd peepdb
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install the package in editable mode with development dependencies:

    pip install -e .[dev]
    

Running Tests

Run the test suite using pytest:

pytest

Code Style

We follow PEP 8 guidelines. You can use tools like flake8 or black to ensure your code adheres to the style guide.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

For more details, please read our Contributing Guide.

๐Ÿ”’ Security

peepDB uses encryption to securely store database connection details. The encryption key is stored in your user directory (~/.peepdb/key.key). Keep this key safe and do not share it.

๐Ÿ“œ 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.

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

peepdb-0.1.2.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

peepdb-0.1.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file peepdb-0.1.2.tar.gz.

File metadata

  • Download URL: peepdb-0.1.2.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for peepdb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 306049410dbda1d51b53e341dfb483bb8514ec295e1f1a5edcf7599e63e9254a
MD5 a8cdae2c3cd893f25485a4e401d2473e
BLAKE2b-256 f1a4bd6f78def52cf30eb5193885d76ec73824fb46e1ae6fd15464d1d82fd5ce

See more details on using hashes here.

File details

Details for the file peepdb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: peepdb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for peepdb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bcf977ca96b3bf1ecc7149dcf15f07c4b2e6ff7231a796029075cef9713085b
MD5 414aa8f92f168da3d3a53bda2c144150
BLAKE2b-256 f420a00f1c120968758839be821765853827141896eddd31588fa94acd501194

See more details on using hashes here.

Supported by

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