Skip to main content

Python CLI for generate resource such as model, controller, service, schema and repository

Project description

Resource Generator For FastApi


Source Code: https://github.com/RatanaKH/resource_generator

Overview

A generate command for a FastAPI project simplifies the creation of common components like models, controllers, services, and schemas. It acts as a code scaffolding tool, ensuring consistent structure, reducing boilerplate, and accelerating development.

Key Reasons for Creating a generate Command

  1. Consistency Across the Codebase: Enforcing a consistent naming convention and folder structure. Preventing errors caused by manual file creation and misplaced code. Ensuring that all components follow best practices and are aligned with project standards.

  2. Improved Developer Productivity: Automating repetitive tasks like creating models, schemas, and services. Reducing time spent writing boilerplate code for new components. Allowing developers to focus on business logic instead of setup tasks.

  3. Scalability for Large Teams: Standardizing the creation process for teams to minimize onboarding effort. Reducing human errors and misunderstandings regarding file and module organization. Making collaboration smoother by enforcing project guidelines automatically.

  4. Maintainability: Encouraging modular and predictable code organization. Generating components with pre-defined templates ensures maintainable and testable code. Easy refactoring and debugging, as all components are structured consistently.

Installation

To install this package, use pip:

  pip install resource-generator

To install this package, use poetry:

  poetry add resource-generator

How to use command

  ratana-pls make-[OPTION] name [FILE_NAME]

Example:

  ratana-pls make-model name Users
  ratana-pls make-controller name Users
  ratana-pls make-repository name Users
  ratana-pls make-schema name Users
  ratana-pls make-service name Users

This package use build over typer library.

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

resource_generator-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

resource_generator-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file resource_generator-0.1.1.tar.gz.

File metadata

  • Download URL: resource_generator-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Windows/10

File hashes

Hashes for resource_generator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 782c538a6a4cc453e91e4a3517b8dbfe316e20689ea70fac59c021de4fc28ad6
MD5 e6049e8926b23c36342078d330faf79f
BLAKE2b-256 34d6ffb8e01558554fea0fbed7519d2418bb2a42984fd43210e8f7ab65ed2a4d

See more details on using hashes here.

File details

Details for the file resource_generator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for resource_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d03c342c2f5c7ede0a0ce61c3d43a1c99e13560f743b216f2e3e972fe7677f17
MD5 cfdc6c73a4174b8c64528d78036186a4
BLAKE2b-256 36dd597437b77c4187cec7aa4051052ad078cf779c8587305667f4f1f0f0a95b

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