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 PyPI (when published)

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.0.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.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbinit-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 86e4cdcd0727ca902456cee2350cb88bdae71516446f94f80a17231d53943c76
MD5 2cfa4f620f0fd8f5cd11cd36ab3fe184
BLAKE2b-256 836e6e5a8390979d0f6dbdef8c73e0eb942e61018f377c9cd02fc88efcacb3e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbinit-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2395e705baa1d14c487cd77ac67fa1fc8411287492a3294f3bdde04f8c3867
MD5 9b6cc0292703e2d1482f737ee19939e3
BLAKE2b-256 4ede82e19f1fb75eb426af8763464d461b36aae647f25f910441d1740141e56b

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