Skip to main content

A powerful Python scaffolding toolkit for rapid project creation with intelligent template system, modular add-ons, and beautiful CLI interface.

Project description

๐Ÿš€ DhruvKit

A powerful Python scaffolding toolkit for rapid project creation with intelligent template system, modular add-ons, and beautiful CLI interface.

Python License


๐ŸŽฏ Create production-ready Python projects in seconds

pip install dhruvkit && dk new myproject --template fastapi --license mit

Get Started โ€ข View Features โ€ข Documentation


โœจ Features

  • ๐ŸŽจ Beautiful CLI Interface - Rich terminal output with colors, panels, and progress indicators
  • ๐Ÿ“ฆ Smart Templates - Pre-configured templates for FastAPI, Flask, and basic Python projects
  • ๐Ÿงฉ Modular Add-ons - Mix and match features like MongoDB, Firebase, and security middleware
  • ๐Ÿ” License Support - Generates projects with multiple license options (MIT, Apache, GPL, BSD, Unlicense, CC0)
  • โšก Intelligent Merging - Automatically combines multiple add-ons without conflicts
  • ๐ŸŽฏ Zero configuration - Ready to run immediately
  • ๐Ÿ“š Auto Documentation - Generates comprehensive README and usage guides

๐Ÿ“ Note: DhruvKit itself is licensed under GPL v2.0. Generated projects may use a different license.

๐Ÿš„ Quick Start

Installation

pip install dhruvkit

๐Ÿ’ก Tip: You can use dk as a shorthand for dhruvkit in all commands!

โšก Recommended Flow

# Create a full-featured app with MongoDB, Firebase, and security in one command
dhruvkit new myapp --template fastapi --mongodb --firebase --secure

# Set up and run
cd myapp
pip install -r requirements.txt
uvicorn src.main:app --reload

๐ŸŽ‰ That's it! You now have a production-ready FastAPI app with MongoDB, Firebase auth, and security middleware.

Install from source
git clone https://github.com/dhruvgarg001/dhruvkit.git
cd dhruvkit
pip install -e .
Optional: Install with runtime dependencies

Optional: Install extras if you want to test templates locally.

# For testing FastAPI template generation
pip install dhruvkit[fastapi]

# For testing Flask template generation
pip install dhruvkit[flask]

# For testing Firebase integration
pip install dhruvkit[firebase]

# For testing MongoDB integration
pip install dhruvkit[mongodb]

# Install all extras
pip install dhruvkit[fastapi,flask,mongodb,firebase]

More Examples

# Basic FastAPI project
dk new myapp --template fastapi

# Flask project with MIT license
dk new myapp -t flask --license mit

# Initialize in current directory
dk init --template basic

# Add a license later
dk add --license apache

๐Ÿ“– Usage

Commands

new - Create a new project

dhruvkit new <project_name> [--template TEMPLATE] [--license LICENSE] [addons...]

Examples:

dhruvkit new blog --template fastapi
dk new api -t fastapi --mongodb --firebase  # Using short aliases
dhruvkit new myapp --template flask --license apache

init - Initialize in current directory

dhruvkit init [--template TEMPLATE] [--license LICENSE] [addons...]

Examples:

dhruvkit init --template fastapi
dhruvkit init --template fastapi --mongodb --secure

add - Add license to existing project

dhruvkit add --license LICENSE

Examples:

dhruvkit add --license mit
dhruvkit add --license apache

docs - View documentation

dhruvkit docs [command]

Available Templates

Template Description Add-ons Available
basic Minimal Python project None
flask Flask web application None
fastapi FastAPI application mongodb, firebase, secure

FastAPI Add-ons

--mongodb - MongoDB Atlas Integration

  • Complete database connection management
  • Collection utilities and indexing
  • Lifespan event handling
  • Usage documentation

--firebase - Firebase Admin SDK

  • Firebase authentication support
  • Firestore database access
  • Real-time database support
  • Comprehensive integration guide

--secure - Security Middleware

  • CORS configuration
  • Host checking middleware
  • Security headers (CSP, X-Frame-Options, X-Content-Type-Options)
  • Production-ready security setup

Mix & Match Add-ons

DhruvKit intelligently combines multiple add-ons:

# MongoDB + Firebase
dhruvkit new myapp --template fastapi --mongodb --firebase

# All three add-ons together
dhruvkit new myapp --template fastapi --mongodb --firebase --secure

The generated code automatically merges:

  • โœ… Import statements
  • โœ… Configuration files (.env, settings.py)
  • โœ… Dependencies (requirements.txt)
  • โœ… README documentation
  • โœ… Application initialization

Supported Licenses

  • mit - MIT License
  • apache - Apache License 2.0
  • gpl - GNU General Public License v3.0
  • bsd - BSD 3-Clause License
  • unlicense - The Unlicense
  • cc / cc0 - Creative Commons Zero v1.0

๐Ÿ—๏ธ Project Structure

A typical FastAPI project with add-ons:

myapp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ database_functions/      # MongoDB utilities (if --mongodb)
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ MongoDBConfig.py
โ”‚   โ”œโ”€โ”€ main.py                  # FastAPI application
โ”‚   โ”œโ”€โ”€ dbconfig.py              # Database initialization (if --mongodb)
โ”‚   โ””โ”€โ”€ settings.py              # Configuration
โ”œโ”€โ”€ docs/                        # Auto-generated documentation
โ”‚   โ”œโ”€โ”€ mongodb_usage.md
โ”‚   โ”œโ”€โ”€ firebase_usage.md
โ”‚   โ””โ”€โ”€ security_guide.md
โ”œโ”€โ”€ .env                         # Environment variables
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ LICENSE                      # If --license specified
โ””โ”€โ”€ README.md                    # Project documentation

๐ŸŽฏ Why DhruvKit?

Before DhruvKit

# Manual setup required
mkdir myapp && cd myapp
python -m venv .venv
touch main.py settings.py .env .gitignore
# ... write boilerplate code
# ... set up MongoDB connection
# ... configure Firebase
# ... add security middleware
# ... write documentation

With DhruvKit

dhruvkit new myapp --template fastapi --mongodb --firebase --secure
cd myapp && pip install -r requirements.txt
uvicorn src.main:app --reload
# ๐ŸŽ‰ Ready to code!

๐Ÿ”ง Development

Project Structure

dhruvkit/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ dhruvkit/
โ”‚       โ”œโ”€โ”€ commands/           # Command implementations
โ”‚       โ”‚   โ”œโ”€โ”€ new.py
โ”‚       โ”‚   โ”œโ”€โ”€ init.py
โ”‚       โ”‚   โ”œโ”€โ”€ add.py
โ”‚       โ”‚   โ””โ”€โ”€ docs.py
โ”‚       โ”œโ”€โ”€ templates/          # Project templates
โ”‚       โ”‚   โ”œโ”€โ”€ basic.py
โ”‚       โ”‚   โ”œโ”€โ”€ flask.py
โ”‚       โ”‚   โ””โ”€โ”€ fastapi.py
โ”‚       โ”œโ”€โ”€ license_templates/  # License files
โ”‚       โ”œโ”€โ”€ cli.py             # CLI entry point
โ”‚       โ”œโ”€โ”€ licenses.py        # License handler
โ”‚       โ””โ”€โ”€ utils.py           # Shared utilities
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

Contributing

Contributions are welcome! Feel free to:

  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Suggest new features
  • ๐Ÿ”ง Submit pull requests
  • ๐Ÿ“– Improve documentation

๐Ÿ“ License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with Rich for beautiful terminal output
  • Uses python-decouple for environment management

๐Ÿ“ฌ Contact

Created by Dhruv Garg


Made with โค๏ธ and Python

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

dhruvkit-0.1.1.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

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

dhruvkit-0.1.1-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dhruvkit-0.1.1.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhruvkit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8bec46dcf045e8fd2838c321b0a59125426413494baaafba127448a64e28316a
MD5 d8b24a590490b55d4785626bd15f120c
BLAKE2b-256 7689721bda9aed852783c94d38305ac7f761ae43fa4af172cd6f7d172b17af03

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhruvkit-0.1.1.tar.gz:

Publisher: publish.yml on DhruvGarg001/dhruvkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dhruvkit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 58.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhruvkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89565ed2adafa496243d5132f37de6ba182cc50d38b82e6b3b370ec6301b1af6
MD5 0942b0526cea5dda210556f42f3b640c
BLAKE2b-256 e9f0fdf379180c49ba4f8746d5ab3417f2909ea8060190ef5bf6a18aa5c077fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhruvkit-0.1.1-py3-none-any.whl:

Publisher: publish.yml on DhruvGarg001/dhruvkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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