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 .

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.1.1.tar.gz (6.7 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.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dbinit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0245ffdf0089de75efa81757257f5596b88c6cea667f09f9716fba35f3d17c93
MD5 1fa5e1169a7fb2d8e23acdbaf030d0e4
BLAKE2b-256 daeecf85249f329d1965117814861ca9cf57f77b130c93dd3e10442e85c7986c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbinit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a21fd270271b2ef27d631d257e4573d0e98e24277149c64837b18841e47ebecb
MD5 321a83c6eaf49a55ec2a08bb1d4d2631
BLAKE2b-256 5305624c8c623d8828b257b22597ef93675d7d764df883b61e1e16ee4342b23a

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