Interactive database initialization tool
Project description
dbinit
Interactive database initialization tool for setting up local databases with secure credential management.
Features
- Interactive credential setup with password hiding
- Password strength validation
- Support for PostgreSQL (via Docker) and SQLite
- Automatic project scaffolding
- Secure credential storage in
.envfiles - Never prints passwords by default
Installation
From pip
pip install dbinit
From Source
Clone the repository and install:
# Regular installation
pip install .
# Or editable/development installation
pip install -e .
Development Setup
pip install -r requirements.txt
pip install -e .
Initial Setup
After installation, run the interactive setup wizard to configure dbinit:
dbinit setup
This will guide you through configuring:
- Default project path (where new projects are created)
- Default database type (postgres or sqlite)
- Auto-start database option
- Docker Compose command preference
- Default editor
View your current configuration:
dbinit setup --show
See SETUP_GUIDE.md for detailed setup instructions.
Usage
Create a New Database Project
# PostgreSQL project
dbinit create myproject --db postgres
# SQLite project
dbinit create myproject --db sqlite
The tool will:
- Prompt for database username
- Prompt for password (hidden input)
- Validate password strength
- Require password confirmation
- Generate project structure
- Start the database (for PostgreSQL)
View Stored Credentials
dbinit creds --show myproject
Project Structure
When you create a project, the following structure is generated:
myproject/
├── docker-compose.yml # PostgreSQL configuration (Postgres only)
├── .env # Database credentials (never committed)
├── .gitignore # Git ignore rules
├── migrations/ # Database migrations directory
└── README.md # Project documentation
Password Requirements
Passwords must meet the following criteria:
- At least 8 characters long
- At least one uppercase letter
- At least one lowercase letter
- At least one digit
- At least one special character (!@#$%^&*()_+-=[]{}|;:,.<>?)
Security
- Passwords are never printed to the console by default
- Credentials are stored in
.envfiles (automatically gitignored) - Use
dbinit creds --showto view credentials when needed - Never commit
.envfiles to version control
Requirements
- Python 3.7+
- Docker and Docker Compose (for PostgreSQL projects)
License
MIT
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
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 dbinit-0.2.0.tar.gz.
File metadata
- Download URL: dbinit-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
947933dfcbcae6ad21e1b3e512802a1924446e8f6332be1421944b418749ac21
|
|
| MD5 |
8cf72da8b4abd55be5d2ad6e8a379cee
|
|
| BLAKE2b-256 |
d37c230a2ea5d4ac827b8f03df0d29a7e771b97de9930d8aef7a10cbf9c7e9b0
|
File details
Details for the file dbinit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dbinit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caeb5ce3d577366f25b96dabe5e7ecaacb7d71fa9834b6547bb4c4089b29563c
|
|
| MD5 |
32ebbcc0fb095f876c3083612a5e4c38
|
|
| BLAKE2b-256 |
c940d5b104849a250127916d05dc2b844ca81fd0d6bc15c357270304d6617a15
|