Skip to main content

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 .env files
  • 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:

  1. Prompt for database username
  2. Prompt for password (hidden input)
  3. Validate password strength
  4. Require password confirmation
  5. Generate project structure
  6. 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 .env files (automatically gitignored)
  • Use dbinit creds --show to view credentials when needed
  • Never commit .env files 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

dbinit-0.2.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

dbinit-0.2.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file dbinit-0.2.2.tar.gz.

File metadata

  • Download URL: dbinit-0.2.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for dbinit-0.2.2.tar.gz
Algorithm Hash digest
SHA256 48f1b9c6b8563b0dfb36e773c58c3fbd5b87ce51d143865be5a61c381cfce0db
MD5 2be68ca2a9d89e3acbba7fdfafd02e68
BLAKE2b-256 523520e1876374f524838825dbf40ba9174f8c2146a6cfd060085a8b84bb060e

See more details on using hashes here.

File details

Details for the file dbinit-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: dbinit-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for dbinit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e330f69ce0129f54bb6bfa53dfa315d4d3ad5098d63547238ad3866feec7a39f
MD5 30273841e88496a6decbff0e4da2d89c
BLAKE2b-256 600326722a68f4cc253d9a7bb87dcdd42a816ab27ce36983d94702d7a1ccb5a6

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