Skip to main content

Professional project structure generator with JSON and YAML template support

Project description

TentyPy Builder

Professional Python Project Structure Generator

Create production-ready projects with enterprise-grade architecture in seconds

PyPI Version Python Support Build Status Code Coverage License Code Style Downloads

InstallationQuick StartTemplatesDocumentationContributing


Overview

TentyPy Builder is a command-line tool designed to scaffold Python projects with professional, production-ready architectures. Stop wasting time on boilerplate and focus on building features.

Key Features

Template Flexibility

  • Multiple pre-built templates for common architectures
  • Support for both JSON and YAML template formats
  • Easy creation of custom templates

Developer Experience

  • Interactive CLI with intuitive prompts
  • Rich terminal output with progress indicators
  • Comprehensive validation and error handling

Production Ready

  • Clean Architecture and Domain-Driven Design patterns
  • Pre-configured testing and linting setup
  • Best practices for scalability and maintainability

Zero Dependencies

  • Lightweight core with optional enhancements
  • No heavy frameworks required
  • Fast installation and execution

Installation

Basic Installation

pip install tentypy-builder

With Optional Features

# YAML template support
pip install tentypy-builder[yaml]

# All features
pip install tentypy-builder[all]

From Source

git clone https://github.com/keniding/tentypy-builder.git
cd tentypy-builder
pip install -e .

Requirements

  • Python 3.8 or higher
  • pip 20.0 or higher

Quick Start

Interactive Mode

The easiest way to create a new project:

tentypy-builder create -i

This will guide you through:

  1. Template selection
  2. Project naming
  3. Variable configuration
  4. Project generation

Direct Creation

Create a project with a specific template:

tentypy-builder create my_project -t clean_architecture

With Custom Variables

tentypy-builder create my_api \\
  -t fastapi_basic \\
  -v AUTHOR="John Doe" \\
  -v PYTHON_VERSION=3.11 \\
  -v DATABASE=postgresql

Using Custom Templates

tentypy-builder create my_project -c ./my_template.yaml

Available Templates

Clean Architecture

Best for: Enterprise applications, complex business logic

tentypy-builder create my_app -t clean_architecture

Structure:

  • Domain layer with entities and value objects
  • Application layer with use cases
  • Infrastructure layer with repositories
  • Presentation layer with controllers

FastAPI Basic

Best for: REST APIs, microservices

tentypy-builder create my_api -t fastapi_basic

Includes:

  • FastAPI application setup
  • Router structure
  • Pydantic models
  • Basic middleware configuration

FastAPI Advanced

Best for: Production APIs with database

tentypy-builder create my_api -t fastapi_advanced

Includes:

  • SQLAlchemy ORM integration
  • Alembic migrations
  • Authentication setup
  • Docker configuration

Django DDD

Best for: Web applications with complex domains

tentypy-builder create my_web -t django_ddd

Includes:

  • Django project structure
  • DDD layers implementation
  • Custom user model
  • Admin configuration

Microservices

Best for: Distributed systems

tentypy-builder create my_service -t microservices

Includes:

  • Service isolation
  • Event-driven architecture
  • API gateway pattern
  • Service discovery setup

CLI Commands

List Templates

View all available templates:

tentypy-builder list

Template Information

Get detailed information about a template:

tentypy-builder info fastapi_basic

Validate Template

Validate a custom template file:

tentypy-builder validate my_template.json

Help

tentypy-builder --help
tentypy-builder create --help

Creating Custom Templates

JSON Format

{
  "name": "my_template",
  "description": "My custom template",
  "version": "1.0.0",
  "author": "Your Name",
  "structure": [
    "src/",
    "tests/",
    {"config": ["settings.py", "__init__.py"]}
  ],
  "files": {
    "README.md": "# {{PROJECT_NAME}}\\n\\nCreated by {{AUTHOR}}",
    "src/main.py": "def main():\\n    pass"
  },
  "variables": {
    "PROJECT_NAME": "my_project",
    "AUTHOR": "Unknown",
    "PYTHON_VERSION": "3.11"
  }
}

YAML Format

name: my_template
description: My custom template
version: 1.0.0
author: Your Name

structure:
  - src/
  - tests/
  - config:
      - settings.py
      - __init__.py

files:
  README.md: |
    # {{PROJECT_NAME}}

    Created by {{AUTHOR}}

  src/main.py: |
    def main():
        pass

variables:
  PROJECT_NAME: my_project
  AUTHOR: Unknown
  PYTHON_VERSION: "3.11"

Documentation

Project Structure

tentypy-builder/
├── tentypy/
│   ├── builder/
│   │   ├── core/
│   │   │   ├── template_engine.py
│   │   │   ├── file_generator.py
│   │   │   └── validator.py
│   │   ├── templates/
│   │   │   ├── clean_architecture.json
│   │   │   ├── fastapi_basic.json
│   │   │   └── ...
│   │   └── cli.py
│   └── utils/
├── tests/
├── docs/
└── examples/

Architecture

TentyPy Builder follows a modular architecture:

  • Template Engine: Loads and processes templates
  • File Generator: Creates project structure
  • Validator: Ensures template correctness
  • CLI: User interface layer

Development

Setup Development Environment

# Clone repository
git clone https://github.com/keniding/tentypy-builder.git
cd tentypy-builder

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\\Scripts\\activate     # Windows

# Install development dependencies
pip install -r requirements-dev.txt
pip install -e .

Running Tests

# Run all tests
pytest

# With coverage report
pytest --cov=tentypy --cov-report=html

# Run specific test file
pytest tests/test_builder.py -v

# Run with markers
pytest -m unit
pytest -m integration

Code Quality

# Format code
black tentypy tests

# Lint
flake8 tentypy

# Type checking
mypy tentypy

Building Package

# Build distribution
python -m build

# Check distribution
twine check dist/*

# Upload to TestPyPI
twine upload --repository testpypi dist/*

# Upload to PyPI
twine upload dist/*

Contributing

Contributions are welcome! Please follow these guidelines:

Reporting Issues

  • Use the issue tracker for bug reports and feature requests
  • Provide detailed information and reproduction steps
  • Include Python version and OS information

Pull Requests

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Update documentation
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Development Standards

  • Follow PEP 8 style guide
  • Write comprehensive tests (maintain >95% coverage)
  • Document all public APIs
  • Use type hints
  • Keep commits atomic and well-described

Changelog

Version 1.0.0 (2024-11-09)

Initial Release

  • Core template engine with JSON/YAML support
  • Interactive CLI with Rich integration
  • Five pre-built templates
  • Comprehensive test suite (97% coverage)
  • Full documentation

Roadmap

Version 1.1.0

  • Web-based template editor
  • Template marketplace
  • Docker integration
  • CI/CD template generation

Version 1.2.0

  • VS Code extension
  • GitHub integration
  • Template versioning
  • Dependency management

Version 2.0.0

  • Plugin system
  • Multi-language support
  • Cloud deployment templates
  • Advanced customization options

License

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


Support

Getting Help

Security

For security issues, please email kenidingh@gmail.com directly instead of using the issue tracker.


Acknowledgments

Built with:

Inspired by:


Author

Henry Keniding Tarazona Lazaro (Tenty)


Statistics

GitHub repo size GitHub code size GitHub commit activity GitHub last commit GitHub issues GitHub pull requests


⬆ Back to Top

Made with dedication by Keniding

If this project helped you, please consider giving it a ⭐

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

tentypy_builder-1.0.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

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

tentypy_builder-1.0.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file tentypy_builder-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for tentypy_builder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a3243d6102923bf691921f9e199787307426c2619574489fa971ce945bcd99f4
MD5 b0b1e66b5052ac6021dd76abd78cd5a7
BLAKE2b-256 6919181f413b1d6f07acc1426a09a48906af757684560d3a31b6f5af9a1298b4

See more details on using hashes here.

File details

Details for the file tentypy_builder-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tentypy_builder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 598720e02be43ebb5dda2fdb2d99df3b79bcf5b02151dc77f2520a65c85d6048
MD5 d106dcde0a012b1ebcf5978aacca2402
BLAKE2b-256 171d6f5819a8c24899d79a4a3f71b807a1456ee7a0b21406834aa7be85b9acb2

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