Skip to main content

Add your description here

Project description

Fast-Craftsmanship CLI Tool

Fast-Craftsmanship is a CLI tool designed to streamline the management and scaffolding of FastAPI projects. It follows best practices to help you create a clean, consistent, and scalable project structure, whether you are starting a new project or adding features to an existing one.

Features

  • Project Initialization: Quickly scaffold a new FastAPI project with a pre-defined structure.
  • DDD Structure Generation: Generate files for domain, service, API, repository, and tests following Domain-Driven Design principles.
  • Database Migrations: Easily create, apply, and rollback database migrations.
  • Code Verification: Run type checking, linting, tests, and formatting checks using a single command.
  • Extensibility: Easily extend the CLI with custom templates and commands.

Installation

From PyPI

If the package is available on PyPI:

pip install fast-craftsmanship

From Source

Clone the repository and install in editable mode:

git clone <repository-URL>
cd fcship
pip install -e ".[dev]"

Usage

After installation, use the CLI by invoking craftsmanship followed by the desired command.

Basic Commands

  • Project Initialization

    craftsmanship project init <project_name>
    
  • Domain Generation

    craftsmanship domain create <domain_name>
    
  • Service Layer Generation

    craftsmanship service create <service_name>
    
  • API Endpoint Generation

    craftsmanship api create <api_name>
    
  • Repository Implementation

    craftsmanship repo create <repository_name>
    
  • Test File Generation

    craftsmanship test create <unit|integration> <test_name>
    
  • Database Migrations

    craftsmanship db migration <migration_name>
    craftsmanship db migrate
    craftsmanship db rollback
    
  • Code Verification

    craftsmanship verify <all|type|lint|test|format>
    

Additional

  • Version Information
    craftsmanship --version
    

Project Structure

When a new project is initialized, the following structure is created:

├── api/              # API endpoints and schemas
├── domain/           # Domain entities and interfaces
├── service/          # Service layer implementation
├── infrastructure/   # Database and external services
└── tests/            # Test suites (unit and integration)

Development

Setup

# Clone the repository
git clone <repository-URL>
cd fast-craftsmanship

# Install in development mode
make dev-install

Available Commands

Run make help to see all available commands:

clean                Clean up build artifacts
check-all            Run linting and tests
dev-install          Install the package with development dependencies
docs                 Generate documentation (placeholder - add your documentation command)
format               Format code with ruff
help                 Show this help
install              Install the package
lint                 Lint code with ruff
release              Create a new release (placeholder - add your release commands)
test                 Run all tests
test-cov             Run tests with coverage report

Releasing New Versions

This project uses GitHub Actions for CI/CD with semantic versioning:

  1. To create a new release, go to the GitHub Actions tab and run the "Bump Version" workflow
  2. Choose the version type (patch, minor, or major)
  3. The workflow will:
    • Update the version in pyproject.toml
    • Commit and push the changes
    • Create a tag for the new version
    • Trigger the release workflow

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/my-feature
  3. Commit your changes.
  4. Push your branch: git push origin feature/my-feature
  5. Open a pull request describing your feature.

License

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

Support

If you encounter issues or have suggestions, please open an issue in the repository.


Happy coding with Fast-Craftsmanship! 🚀

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

fast_craftsmanship-0.1.0.tar.gz (74.2 kB view details)

Uploaded Source

Built Distribution

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

fast_craftsmanship-0.1.0-py3-none-any.whl (99.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fast_craftsmanship-0.1.0.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fast_craftsmanship-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0bac159eaa967c216794313e88b33c2d3eeb865e689a6856855bce5390d02c7
MD5 874707f9a0f09f3b03199a6c3aac31b6
BLAKE2b-256 c42b930bf623819975c4d8ae26444914819c2999d142b2246bad18f7ada9275b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_craftsmanship-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64e0f31de9be41b6d74478624a745ca0dc8b3bf936b4748afe3b4d8b6e06d81c
MD5 361ad6ccdb25567767e98b6a12dd02dd
BLAKE2b-256 3809dc023148ec60ead01067d09000881e873b61223451bf0e7706f2d3bd838a

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