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.1.tar.gz (9.9 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbinit-0.2.1.tar.gz
  • Upload date:
  • Size: 9.9 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.1.tar.gz
Algorithm Hash digest
SHA256 dc525893ecb006708a2984469a8fc046ba7763b3bac3080c71a40c6f28f87d28
MD5 aa72381688e5cd1ca12573d297d439ad
BLAKE2b-256 5faeba0175e0a48d460c5cb34c753539a54feb7dfa32d13f026f878b86be52d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbinit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 835740ed9f4370425cb99efd0025160aff572dfa1797dbcdd0a63ecaed229fa6
MD5 41e522b2f0053e8e5ef2cdbf2fc856af
BLAKE2b-256 80bdba03d7a46bca3b6d32aad45303daed545373b9b542092a320144b8c7dc04

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