tentypy-builder 1.0.0
Professional project structure generator with JSON and YAML template support
License: MIT
Requires Python: >=3.8
Keywords: project-generator, template, builder, architecture, clean-architecture, ddd, microservices, fastapi, django

<div align="center">

# TentyPy Builder

### Professional Python Project Structure Generator

**Create production-ready projects with enterprise-grade architecture in seconds**

[![PyPI Version](https://img.shields.io/pypi/v/tentypy-builder?color=blue&label=PyPI)](https://pypi.org/project/tentypy-builder/)
[![Python Support](https://img.shields.io/pypi/pyversions/tentypy-builder?color=blue)](https://pypi.org/project/tentypy-builder/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/keniding/tentypy-builder/ci.yml?branch=main&label=tests)](https://github.com/keniding/tentypy-builder/actions)
[![Code Coverage](https://img.shields.io/codecov/c/github/keniding/tentypy-builder?token=YOUR_TOKEN)](https://codecov.io/gh/keniding/tentypy-builder)
[![License](https://img.shields.io/github/license/keniding/tentypy-builder?color=green)](LICENSE)
[![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
[![Downloads](https://img.shields.io/pypi/dm/tentypy-builder?color=blue)](https://pypistats.org/packages/tentypy-builder)

[Installation](#installation) •
[Quick Start](#quick-start) •
[Templates](#available-templates) •
[Documentation](#documentation) •
[Contributing](#contributing)

</div>

---

## 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

```bash
pip install tentypy-builder
```

### With Optional Features

```bash
# YAML template support
pip install tentypy-builder[yaml]

# All features
pip install tentypy-builder[all]
```

### From Source

```bash
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:

```bash
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:

```bash
tentypy-builder create my_project -t clean_architecture
```

### With Custom Variables

```bash
tentypy-builder create my_api \\
  -t fastapi_basic \\
  -v AUTHOR="John Doe" \\
  -v PYTHON_VERSION=3.11 \\
  -v DATABASE=postgresql
```

### Using Custom Templates

```bash
tentypy-builder create my_project -c ./my_template.yaml
```

---

## Available Templates

### Clean Architecture
**Best for:** Enterprise applications, complex business logic

```bash
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

```bash
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

```bash
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

```bash
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

```bash
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:

```bash
tentypy-builder list
```

### Template Information

Get detailed information about a template:

```bash
tentypy-builder info fastapi_basic
```

### Validate Template

Validate a custom template file:

```bash
tentypy-builder validate my_template.json
```

### Help

```bash
tentypy-builder --help
tentypy-builder create --help
```

---

## Creating Custom Templates

### JSON Format

```json
{
  "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

```yaml
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

```bash
# 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

```bash
# 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

```bash
# Format code
black tentypy tests

# Lint
flake8 tentypy

# Type checking
mypy tentypy
```

### Building Package

```bash
# 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](LICENSE) file for details.

---

## Support

### Getting Help

- **Documentation**: [GitHub Wiki](https://github.com/keniding/tentypy-builder/wiki)
- **Issues**: [GitHub Issues](https://github.com/keniding/tentypy-builder/issues)
- **Discussions**: [GitHub Discussions](https://github.com/keniding/tentypy-builder/discussions)
- **Email**: kenidingh@gmail.com

### Security

For security issues, please email kenidingh@gmail.com directly instead of using the issue tracker.

---

## Acknowledgments

Built with:
- [Rich](https://github.com/Textualize/rich) - Terminal formatting
- [Click](https://click.palletsprojects.com/) - CLI framework
- [PyYAML](https://pyyaml.org/) - YAML processing
- [pytest](https://pytest.org/) - Testing framework

Inspired by:
- [cookiecutter](https://github.com/cookiecutter/cookiecutter)
- [yeoman](https://yeoman.io/)
- Clean Architecture principles by Robert C. Martin

---

## Author

**Henry Keniding Tarazona Lazaro (Tenty)**

- GitHub: [@keniding](https://github.com/keniding)
- Email: kenidingh@gmail.com

---

## Statistics

![GitHub repo size](https://img.shields.io/github/repo-size/keniding/tentypy-builder)
![GitHub code size](https://img.shields.io/github/languages/code-size/keniding/tentypy-builder)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/keniding/tentypy-builder)
![GitHub last commit](https://img.shields.io/github/last-commit/keniding/tentypy-builder)
![GitHub issues](https://img.shields.io/github/issues/keniding/tentypy-builder)
![GitHub pull requests](https://img.shields.io/github/issues-pr/keniding/tentypy-builder)

---

<div align="center">

**[⬆ Back to Top](#tentypy-builder)**

Made with dedication by [Keniding](https://github.com/keniding)

If this project helped you, please consider giving it a ⭐

</div>