A powerful CLI tool to generate Python project boilerplates
Project description
Projex
A powerful CLI tool to generate production-ready Python project boilerplates instantly. Skip the boring setup and jump straight into coding!
โจ Features
- ๐ Quick Setup - Generate complete project structures in seconds
- ๐ฏ 8 Framework Templates - FastAPI, Django, Flask, Bottle, Pyramid, Tornado, Sanic, CherryPy
- ๐ฆ Batteries Included - Pre-configured with best practices
- ๐ณ Docker Ready - Includes Dockerfile and docker-compose
- โ Testing Setup - pytest configuration out of the box
- ๐ง Smart Scaffolding - Add models, endpoints, services, middleware with one command
- ๐ 4 Authentication Methods - JWT, OAuth2, API Key, Basic Auth
- ๐๏ธ 5 Database Options - PostgreSQL, MySQL, MongoDB, SQLite, Redis
- ๐จ 3 Template Styles - Minimal, Standard, Full
- ๐ญ Beautiful CLI - Rich terminal output with progress indicators
- ๐ CI/CD Ready - GitHub Actions, GitLab CI, CircleCI configs
- ๐ Documentation Tools - MkDocs and Sphinx setup
- ๐งช Enhanced Testing - Advanced pytest configs, fixtures, factories
- ๐ Project Validation - Validate structure and dependencies
- ๐ Dependency Management - Check outdated packages, security audits
- ๐ Environment Management - Multiple environment configurations
- ๐ Makefile Generator - Common development tasks automated
- โ๏ธ License Selection - MIT, Apache, GPL, BSD, Unlicense
- ๐ Smart .gitignore - Custom gitignore templates via gitignore.io
๐ Framework Templates
FastAPI โก
Modern, fast API framework with automatic documentation
Features:
- โ Async/await support
- โ Automatic API docs (Swagger UI)
- โ Pydantic models for validation
- โ SQLAlchemy ORM integration
- โ Alembic migrations
- โ JWT authentication ready
- โ Docker support
Perfect for: RESTful APIs, WebSocket apps, high-performance services
projex create my-api --template fastapi
Django ๐ฏ
Batteries-included web framework for perfectionists
Features:
- โ Django REST Framework
- โ Admin panel out of the box
- โ ORM with migrations
- โ Custom user model ready
- โ CORS headers configured
- โ Environment variables
- โ pytest-django setup
Perfect for: Web applications, admin dashboards, CMS platforms
projex create my-site --template django
Flask ๐ถ๏ธ
Lightweight and flexible web framework
Features:
- โ Flask-RESTful
- โ Flask-SQLAlchemy
- โ Flask-Migrate
- โ JWT authentication
- โ CORS support
- โ Blueprints structure
- โ Config management
Perfect for: Simple APIs, prototypes, custom architectures
projex create my-app --template flask
Bottle ๐พ
Micro web framework - simple and fast
Features:
- โ Single file framework
- โ No dependencies (except standard library)
- โ Built-in template engine
- โ Simple routing
- โ Fast and lightweight
- โ WSGI compliant
- โ Easy to learn
Perfect for: Small APIs, microservices, learning projects
projex create my-service --template bottle
Pyramid ๐บ
Flexible, scalable web framework
Features:
- โ URL generation
- โ Flexible authentication/authorization
- โ Extensible configuration
- โ SQLAlchemy integration
- โ Traversal and URL dispatch
- โ Built-in internationalization
- โ Highly modular
Perfect for: Large applications, complex routing, enterprise apps
projex create my-app --template pyramid
Tornado ๐ช๏ธ
Async web framework and networking library
Features:
- โ Non-blocking network I/O
- โ WebSocket support
- โ High performance
- โ Asynchronous handlers
- โ Built-in authentication
- โ Template engine
- โ Long polling support
Perfect for: Real-time apps, WebSocket servers, long-polling services
projex create my-realtime --template tornado
Sanic ๐
Fast async framework built on uvloop
Features:
- โ Blazing fast performance
- โ Async/await syntax
- โ Simple routing
- โ Class-based views
- โ Blueprint support
- โ Middleware support
- โ WebSocket support
Perfect for: High-performance APIs, async services, real-time apps
projex create my-fast-api --template sanic
CherryPy ๐
Minimalist Python web framework
Features:
- โ HTTP/1.1-compliant WSGI server
- โ Simple object-oriented approach
- โ Built-in tools (sessions, auth, caching)
- โ Thread-pooled web server
- โ Plugin system
- โ Configuration system
- โ Mature and stable
Perfect for: Embedded applications, traditional web apps, simple services
projex create my-server --template cherrypy
All templates include:
- โ Docker and docker-compose setup
- โ Database integration ready
- โ Testing setup with pytest
- โ Environment configuration (.env)
- โ CORS support configured
- โ Best practices structure
- โ README with documentation
- โ .gitignore configured
๐ Installation
From PyPI (recommended)
pip install projex
From Source
git clone https://github.com/ChAbdulWahhab/projex.git
cd projex
pip install -e .
๐ป Quick Usage
Interactive Mode (Easiest!)
projex create
The CLI will guide you through:
- Project name
- Framework selection
- Database choice
- Authentication method
- Template style
- Additional options
Command Line Mode
# Simple FastAPI project
projex create my-api --template fastapi
# Complete production-ready setup
projex create my-api \
--template fastapi \
--db postgresql \
--auth jwt \
--style full \
--license mit
# Django with MongoDB
projex create my-site \
--template django \
--db mongodb \
--author "Your Name"
# Minimal Flask app
projex create my-app \
--template flask \
--style minimal \
--no-git
All Create Options
projex create [PROJECT_NAME] [OPTIONS]
Options:
-t, --template TEXT Framework template
[fastapi|django|flask|bottle|pyramid|tornado|sanic|cherrypy]
-p, --path PATH Directory path (default: current directory)
-a, --author TEXT Author name
-d, --description TEXT Project description
--db TEXT Database type
[postgresql|mysql|mongodb|sqlite|redis]
--style TEXT Template style
[minimal|standard|full]
--auth TEXT Authentication method
[jwt|oauth2|apikey|basic]
--license TEXT License type
[mit|apache|gpl|bsd|unlicense]
--gitignore TEXT Gitignore templates (comma-separated)
Example: python,venv,pycharm,vscode
--no-git Skip git initialization
--no-venv Skip virtual environment creation
--help Show help message
List Available Templates
projex list
# Output shows all 8 frameworks with descriptions
๐ ๏ธ Smart Scaffolding
Add components to your existing project:
Add Models
# Simple model
projex add model User --fields name:str,email:str,age:int
# Complex model with multiple field types
projex add model Product --fields name:str,price:float,stock:int,is_active:bool,created_at:datetime
# Supported field types:
# str, int, float, bool, date, datetime, list, dict
Add Endpoints
# CRUD endpoints
projex add endpoint users --crud
# Generates: GET, POST, PUT, DELETE endpoints
Add Services
# Synchronous service
projex add service payment
# Asynchronous service
projex add service email --async
Add Middleware
# CORS middleware
projex add middleware cors
# Authentication middleware
projex add middleware auth
Note: All projex add commands automatically detect your framework and generate appropriate code!
๐ Authentication Options
JWT (JSON Web Tokens)
projex create my-api --template fastapi --auth jwt
Includes:
- Login/register endpoints
- Password hashing with bcrypt
- Token generation and validation
- Protected route examples
- Refresh token support (optional)
OAuth2 (Social Login)
projex create my-api --template fastapi --auth oauth2
Includes:
- Google OAuth2 integration
- GitHub OAuth2 integration
- User profile endpoints
- Token management
- Environment variable configuration
API Key
projex create my-api --template fastapi --auth apikey
Includes:
- API key generation
- Header-based authentication
- Key rotation support
- Rate limiting ready
Basic Authentication
projex create my-api --template flask --auth basic
Includes:
- Username/password authentication
- Base64 encoding
- Simple and straightforward
- Good for internal APIs
๐๏ธ Database Options
PostgreSQL (Recommended for production)
projex create my-api --template fastapi --db postgresql
Includes:
- SQLAlchemy ORM configuration
- Alembic migrations
- Connection pooling
- docker-compose with PostgreSQL service
- Environment variables for connection
MySQL/MariaDB
projex create my-api --template django --db mysql
Includes:
- MySQL-specific SQLAlchemy config
- Docker setup with MySQL
- Character set configuration
MongoDB
projex create my-api --template fastapi --db mongodb
Includes:
- Motor (async) for FastAPI
- PyMongo for sync frameworks
- Document models
- Connection string configuration
- docker-compose with MongoDB
SQLite (Good for development)
projex create my-api --template flask --db sqlite
Includes:
- Zero configuration needed
- File-based database
- Perfect for development/testing
- Easy to version control (optional)
Redis
projex create my-api --template fastapi --db redis
Includes:
- redis-py configuration
- Caching examples
- Session storage setup
- docker-compose with Redis
๐จ Template Styles
Minimal (Bare Bones)
projex create my-api --template fastapi --style minimal
Includes:
- Basic project structure
- Essential files only
- No Docker
- Simple configuration
- Perfect for learning
Standard (Default, Recommended)
projex create my-api --template fastapi --style standard
# or
projex create my-api --template fastapi
Includes:
- Complete project structure
- Docker and docker-compose
- Testing setup
- Environment configuration
- Production-ready
Full (Everything Included)
projex create my-api --template fastapi --style full
Includes:
- Everything from Standard
- CI/CD configuration
- Documentation setup
- Enhanced testing
- Code quality tools
- Makefile
- Multiple environments
- Maximum batteries included!
๐ CI/CD Pipeline Generation
Generate CI/CD configurations:
GitHub Actions
cd my-project
projex add cicd --provider github
Generates: .github/workflows/ci.yml
Includes:
- Test job (pytest)
- Lint job (black, flake8)
- Build job (Docker)
- Deploy job (commented, ready to customize)
GitLab CI
projex add cicd --provider gitlab
Generates: .gitlab-ci.yml
Includes:
- Test stage
- Build stage
- Deploy stage
- Docker image building
CircleCI
projex add cicd --provider circle
Generates: .circleci/config.yml
Includes:
- Workflows
- Jobs (test, build, deploy)
- Orbs integration
๐ Environment Management
Manage multiple environments:
cd my-project
# Create environment files
projex env add development
projex env add staging
projex env add production
projex env add test
# List all environments
projex env list
# Show environment variables (sensitive values masked)
projex env show .env.development
projex env show .env.production
Each environment file includes:
- Database URL
- Secret keys (auto-generated)
- Debug settings
- Environment-specific configs
๐ Dependency Management
Manage project dependencies:
Check Outdated Packages
cd my-project
projex deps check
# Shows:
# - Current version
# - Latest version
# - Update recommendation
Update Packages
# Interactive update (prompts for each package)
projex deps update
# Update specific package
projex deps update --package fastapi
# Update all (auto-confirm)
projex deps update --all
Security Audit
projex deps audit
# Uses pip-audit to check for vulnerabilities
# Shows CVE details and recommendations
๐ Documentation Setup
Add documentation to your project:
MkDocs (Recommended)
cd my-project
projex add docs --tool mkdocs
Generates:
docs/directory with structuremkdocs.ymlconfiguration- Material theme setup
- API documentation template
- Getting started guide
Usage:
mkdocs serve # Start local server
mkdocs build # Build static site
mkdocs gh-deploy # Deploy to GitHub Pages
Sphinx
projex add docs --tool sphinx
Generates:
docs/directory- Sphinx configuration
- ReadTheDocs theme
- API autodoc setup
Usage:
cd docs
make html # Build HTML docs
make clean # Clean build files
๐งช Enhanced Testing
Add advanced testing configuration:
cd my-project
projex add test-config --enhanced
Adds:
- pytest.ini - Advanced pytest configuration
- conftest.py - Common fixtures
- Test factories - Factory pattern for test data
- Coverage config - .coveragerc file
- Test markers - unit, integration, slow markers
- Example tests - Best practices examples
Test markers usage:
pytest -m unit # Run only unit tests
pytest -m integration # Run only integration tests
pytest -m "not slow" # Skip slow tests
pytest --cov=app # Run with coverage
๐ Makefile Generator
Add common development tasks:
cd my-project
projex add makefile
Generated targets:
make install # Install dependencies
make test # Run tests
make test-cov # Run tests with coverage
make run # Start development server
make docker-build # Build Docker image
make docker-up # Start Docker containers
make docker-down # Stop Docker containers
make clean # Clean cache files
make lint # Run linters
make format # Format code
make migrate # Run database migrations (Django/Flask)
make help # Show all commands
Framework-aware: Commands adapt to your framework!
๐ง Code Quality Tools
Add pre-commit hooks and linting:
cd my-project
projex add quality-tools
Adds:
- .pre-commit-config.yaml - Pre-commit hooks
- pyproject.toml - Tool configurations
- black - Code formatting
- isort - Import sorting
- flake8 - Linting
- mypy - Type checking
- pylint - Advanced linting
Setup:
pip install -r requirements-dev.txt
pre-commit install
pre-commit run --all-files # Run manually
๐ Project Validation
Validate your project structure:
cd my-project
projex validate
# or
projex doctor
# Checks:
# โ Required files exist
# โ Project structure is correct
# โ Dependencies are valid
# โ No import errors
# โ Docker files are configured
# โ Tests are runnable
๐ Project Information
Get detailed project stats:
cd my-project
projex info
# Shows:
# - Project name and template
# - Python version
# - Total files and lines of code
# - Dependencies count
# - Last modified date
# - Git status
# - Docker configuration
# - Test count
# - Coverage percentage
โ๏ธ License Selection
Add license during creation:
# MIT License (permissive)
projex create my-api --template fastapi --license mit
# Apache 2.0 (with patent grant)
projex create my-api --template django --license apache
# GPL v3 (copyleft)
projex create my-api --template flask --license gpl
# BSD 3-Clause
projex create my-api --template bottle --license bsd
# Unlicense (public domain)
projex create my-api --template pyramid --license unlicense
๐ Smart .gitignore
Generate custom .gitignore:
# Multiple templates
projex create my-api \
--template fastapi \
--gitignore python,venv,pycharm,vscode,macos
# Uses gitignore.io API to fetch latest templates
Popular templates:
python- Python-specificvenv- Virtual environmentspycharm- PyCharm IDEvscode- VS Codevisualstudio- Visual Studiomacos- macOS fileswindows- Windows fileslinux- Linux filesnode- Node.js (if using frontend)
๐ Project Structure Examples
FastAPI (Standard)
my-api/
โโโ app/
โ โโโ __init__.py
โ โโโ main.py
โ โโโ core/
โ โ โโโ config.py
โ โ โโโ database.py
โ โ โโโ security.py
โ โโโ api/
โ โ โโโ v1/
โ โ โโโ router.py
โ โ โโโ endpoints/
โ โ โโโ users.py
โ โ โโโ items.py
โ โโโ models/
โ โ โโโ __init__.py
โ โ โโโ user.py
โ โโโ schemas/
โ โ โโโ __init__.py
โ โ โโโ user.py
โ โโโ services/
โ โโโ __init__.py
โโโ tests/
โ โโโ conftest.py
โ โโโ test_main.py
โ โโโ api/
โ โโโ test_users.py
โโโ .env.example
โโโ .gitignore
โโโ .pre-commit-config.yaml (if quality-tools added)
โโโ Dockerfile
โโโ docker-compose.yml
โโโ Makefile (if generated)
โโโ pytest.ini
โโโ requirements.txt
โโโ requirements-dev.txt
โโโ README.md
Django (Standard)
my-site/
โโโ config/
โ โโโ __init__.py
โ โโโ settings.py
โ โโโ urls.py
โ โโโ wsgi.py
โ โโโ asgi.py
โโโ apps/
โ โโโ __init__.py
โ โโโ core/
โ โโโ __init__.py
โ โโโ models.py
โ โโโ views.py
โ โโโ urls.py
โ โโโ admin.py
โ โโโ serializers.py
โ โโโ tests.py
โโโ static/
โโโ media/
โโโ templates/
โโโ manage.py
โโโ .env.example
โโโ .gitignore
โโโ Dockerfile
โโโ docker-compose.yml
โโโ pytest.ini
โโโ requirements.txt
โโโ README.md
Flask (Standard)
my-app/
โโโ app/
โ โโโ __init__.py
โ โโโ config.py
โ โโโ api/
โ โ โโโ __init__.py
โ โ โโโ routes.py
โ โโโ models/
โ โ โโโ __init__.py
โ โ โโโ user.py
โ โโโ schemas/
โ โ โโโ __init__.py
โ โโโ services/
โ โโโ __init__.py
โโโ tests/
โ โโโ conftest.py
โ โโโ test_api.py
โโโ migrations/
โโโ run.py
โโโ .env.example
โโโ .gitignore
โโโ Dockerfile
โโโ docker-compose.yml
โโโ requirements.txt
โโโ README.md
๐ฏ Real-World Usage Examples
Production API
projex create production-api \
--template fastapi \
--db postgresql \
--auth jwt \
--style full \
--license mit \
--gitignore python,venv,pycharm,vscode
cd production-api
projex add cicd --provider github
projex add docs --tool mkdocs
projex add quality-tools
projex env add staging
projex env add production
Microservices
# User Service
projex create user-service --template fastapi --db postgresql
# Order Service
projex create order-service --template fastapi --db postgresql
# Payment Service
projex create payment-service --template fastapi --db redis
Monolith Application
projex create my-app \
--template django \
--db mysql \
--auth oauth2 \
--style full
cd my-app
projex add cicd --provider gitlab
projex add docs --tool sphinx
๐ณ Docker Usage
Development
cd my-project
docker-compose up
Production Build
docker build -t my-app:latest .
docker run -p 8000:8000 --env-file .env.production my-app:latest
With Database
# docker-compose automatically starts database service
docker-compose up
# Your app connects to database automatically via DATABASE_URL
โ Testing
Run Tests
cd my-project
source venv/bin/activate
# Install dev dependencies
pip install -r requirements-dev.txt
# Run all tests
pytest
# With coverage
pytest --cov=app --cov-report=html
# Open coverage report
open htmlcov/index.html
Test Markers (if enhanced testing added)
# Unit tests only
pytest -m unit
# Integration tests only
pytest -m integration
# Skip slow tests
pytest -m "not slow"
# Verbose output
pytest -v
# Stop on first failure
pytest -x
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Development Setup
# Clone repository
git clone https://github.com/ChAbdulWahhab/projex.git
cd projex
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install in editable mode
pip install -e .
pip install -r requirements-dev.txt
# Run tests
pytest
# Install pre-commit hooks
pre-commit install
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with Click for CLI
- Rich for beautiful terminal output
- Jinja2 for templating
- Framework logos and inspiration from respective communities
๐ฎ Support
- ๐ง Email: ch.abdul.wahhab@proton.me
- ๐ฌ Discussions: GitHub Discussions
- ๐ Bug Reports: GitHub Issues
- ๐ Documentation: Full Docs
๐บ๏ธ Roadmap
Completed โ
- 8 Framework templates
- 5 Database options
- 4 Authentication methods
- 3 Template styles
- Smart scaffolding system
- CI/CD pipeline generation
- Environment management
- Dependency management
- Documentation setup
- Enhanced testing
- Code quality tools
- Project validation
- License selection
- Smart gitignore
Upcoming ๐
- Frontend templates (React, Vue, Svelte)
- GraphQL templates
- Kubernetes deployment files
- Terraform configurations
- API Gateway templates
- Message queue integration (RabbitMQ, Kafka)
- Monitoring setup (Prometheus, Grafana)
- Plugin system
- Template marketplace
๐ Project Stats
- Templates: 8 frameworks
- Databases: 5 options
- Auth Methods: 4 types
- CI/CD Providers: 3 platforms
- Commands: 15+ commands
- Active Users: Growing daily!
- GitHub Stars: โญ Give us a star!
๐ Show Your Support
If you find Projex helpful, please consider:
- โญ Starring the repository
- ๐ฆ Sharing on social media
- ๐ Writing a blog post
- ๐ค Contributing code
- ๐ฌ Joining discussions
Made with โค๏ธ by Ch. Abdul Wahab
Project Link: https://github.com/ChAbdulWahhab/projex
PyPi Link: https://pypi.org/project/projex-cli/
Happy coding! ๐
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file projex_cli-4.0.1.tar.gz.
File metadata
- Download URL: projex_cli-4.0.1.tar.gz
- Upload date:
- Size: 86.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99721e0d462b54fd0c29b9fef5c9b89745002314c31bdc2ecfd610d6fd2104ca
|
|
| MD5 |
93e5088aa2dfcb989a9160e9ad5cd652
|
|
| BLAKE2b-256 |
09e3e03538e1f043788ab898cb9c74e79b7086418aa6449480520d56ca2d5043
|
File details
Details for the file projex_cli-4.0.1-py3-none-any.whl.
File metadata
- Download URL: projex_cli-4.0.1-py3-none-any.whl
- Upload date:
- Size: 113.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
176ebe4f047e6ce893626021b9742f077a143050618c60e42387b018682c7131
|
|
| MD5 |
efa2c62d653965fdd0a35c138de61838
|
|
| BLAKE2b-256 |
dadabea459caff4b08aa23df8ef893b17d2045919f12b397775163ed6af8e105
|