Skip to main content

A Python CLI template boilerplate generator

Project description

Gentem

Python Version License PyPI Version PyPI Status

Downloads Last Commit Contributors

A Python CLI template boilerplate generator for quickly scaffolding Python projects.

Features

  • Project Scaffolding: Generate Python projects with a single command
  • Multiple Project Types: Support for library, CLI tool, and script projects
  • FastAPI Templates: Pre-configured FastAPI project templates with optional database support
  • Opinionated Structure: Best practices baked into every template
  • Interactive Preview: --dry-run option to preview before creating files

Installation

pip install gentem

Or install from source:

git clone https://github.com/knightlesssword/gentem.git
cd gentem
pip install -e .

Usage

Creating a New Project

# Create a library project
gentem new mylib --type library

# Create a CLI tool project
gentem new mycli --type cli

# Create a simple script project
gentem new myscript --type script

# With author and description
gentem new mylib --type library --author "John Doe" --description "My library"

# With license
gentem new mylib --type library --license mit
gentem new mylib --type library --license apache
gentem new mylib --type library --license gpl

# Preview without creating files
gentem new mylib --type library --dry-run

Creating a FastAPI Project

# Create a basic FastAPI project
gentem fastapi myapi

# Create with async mode and lifespan
gentem fastapi myapi --async

# Create with database support (asyncpg)
gentem fastapi myapi --db asyncpg

# Combine options
gentem fastapi myapi --async --db asyncpg --author "John Doe"

Project Structure

Library Template

mylib/
├── src/
│   └── mylib/
│       ├── __init__.py
│       └── core.py
├── tests/
│   ├── __init__.py
│   └── test_core.py
├── pyproject.toml
├── README.md
├── LICENSE
└── .gitignore

FastAPI Template

myapi/
├── src/
│   └── myapi/
│       ├── __init__.py
│       ├── main.py              # FastAPI application
│       ├── core/
│       │   ├── __init__.py
│       │   ├── config.py        # Settings
│       │   └── exceptions.py    # Custom exceptions
│       ├── deps/
│       │   └── __init__.py      # Dependencies
│       ├── utils/
│       │   └── __init__.py      # Utility functions
│       ├── v1/
│       │   ├── __init__.py
│       │   └── apis/
│       │       ├── __init__.py
│       │       └── routes.py    # API routes
│       ├── services/
│       │   └── __init__.py      # Business logic
│       ├── schemas/
│       │   └── __init__.py      # Pydantic schemas
│       └── models/
│           └── __init__.py      # SQLAlchemy models
├── .env
├── requirements.txt
├── .gitignore
└── README.md

Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black .
ruff check --fix .

# Type checking
mypy .

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

gentem-0.1.3.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

gentem-0.1.3-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file gentem-0.1.3.tar.gz.

File metadata

  • Download URL: gentem-0.1.3.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gentem-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5eddc2ef63e0bda39a7c16563ebd2198a9d9855508c6bf5150046433ac52ede5
MD5 1968545eb60902114cd9ce88c290a49e
BLAKE2b-256 f531e288b34bbc4393e25115117ac5f65509006290104d37c8a5e579db1933d0

See more details on using hashes here.

File details

Details for the file gentem-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gentem-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gentem-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bc0ce8c922b27906b0a8534a3e3e5836614b7ddabfed8de9d3ea2bfb28fd8bf
MD5 b786ea4de6a9cde7560d69f496365fa6
BLAKE2b-256 7568e0beff09fa00fe9da62adecce200b5f38e55517fe3a3cc09a4ecefaedc19

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