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
-
Save MySQL connection details:
peepdb myapp_db --save --db-type mysql --host localhost --user root --password mypassword --database myapp
-
View all tables in the saved MySQL database:
peepdb myapp_db
-
View a specific table:
peepdb myapp_db --table users
-
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
-
Clone the repository:
git clone https://github.com/yourusername/peepdb.git cd peepdb
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - 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
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 306049410dbda1d51b53e341dfb483bb8514ec295e1f1a5edcf7599e63e9254a |
|
MD5 | a8cdae2c3cd893f25485a4e401d2473e |
|
BLAKE2b-256 | f1a4bd6f78def52cf30eb5193885d76ec73824fb46e1ae6fd15464d1d82fd5ce |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bcf977ca96b3bf1ecc7149dcf15f07c4b2e6ff7231a796029075cef9713085b |
|
MD5 | 414aa8f92f168da3d3a53bda2c144150 |
|
BLAKE2b-256 | f420a00f1c120968758839be821765853827141896eddd31588fa94acd501194 |