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.

PyPI version Downloads 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.0.tar.gz (35.0 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.0-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dhruvkit-0.1.0.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for dhruvkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f47d5d919981a3122db534c8112d756b5da37d3ed6563a341aadbf2765cdf97
MD5 0a9c913a3b84ef02734f3efb7dbc7346
BLAKE2b-256 56fc8db23be201d71cd95293c3e70a879f813a60a8a37ffcd5574788308c4738

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dhruvkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for dhruvkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a1fa7401a064b6755c1fbc68f6fcbb35332c89cf4e8775e938cd4a1c64a93cd
MD5 02b5d0f1d1e174f03e62d0185b911907
BLAKE2b-256 92a6de3ff47b9601a29bea1e1f29931c3b559193b321c816e683487b957d7bd8

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