Skip to main content

A CLI tool for generating Flask resources

Project description

FlaskForge

FlaskForge is a versatile CLI tool designed to streamline the development of Flask applications by automating the creation and management of essential resources. Inspired by Laravel's Artisan CLI, FlaskForge simplifies the setup and generation of various components in your Flask projects, allowing you to focus on building your application.

Features

  • Initialize a Flask Project: Set up a new Flask project with customizable options using the initapp command. This command helps you quickly scaffold a new application with features like:

    • Project Name: Specify the name for your new Flask project.
    • JWT Authentication: Enable or disable JSON Web Token (JWT) authentication (default: enabled).
    • Swagger Documentation: Enable or disable Swagger OpenAPI documentation (default: enabled).
    • Force Creation: Overwrite existing files if a project with the same name already exists.
  • Generate API Resources: Use the create command to scaffold various API components, including models and their associated endpoints:

    • Model Creation: Define the name of the model to generate a new model class.
    • Getter/Setter Methods: Optionally include getter and setter methods for private properties.
    • Endpoint Methods: Specify which HTTP methods (e.g., 'GET,POST') to include or exclude for your model's endpoints.
    • Model Only: Generate only the model class without additional endpoints.
    • Search and Single Methods: Configure the model to use search methods instead of the default get_all.
  • Authentication Resources: The create:authentication command generates authentication-related resources for a specified model:

    • Username Field: Define the field in the model for storing usernames.
    • Password Field: Define the field in the model for storing passwords.
  • Resource Management: The create:resource command sets up resource-related components for a specified model, including:

    • Resource Name: Specify the name of the resource.
    • Endpoint Methods: Define which HTTP methods to include or exclude.
    • URL Prefix: Set a URL prefix for grouping related routes.
    • Search and Single Methods: Configure methods for querying resources.
    • Query Parameters: Define parameters and their types for filtering.

Installation

To install FlaskForge, use pip:

pip install flaskforge

Usage

Here are the commands available with FlaskForge:

Initialize a New Project:

flaskforge initapp <project_name> [--jwt-enable] [--swagger-enable] [--force]

Generate API Resources:

flaskforge create <model_name> [--getter-setter] [--endpoints <methods>] [--exclude-endpoints <methods>] [--model-only] [--use-search] [--use-single] [--param <param>] [--type <type>] [--force]

Create Authentication Resource

flaskforge create:authentication <model_name> --username-field <field_name> --password-field <field_name>

Create Resource Components:

flaskforge create:resource <model_name> --name <resource_name> [--endpoints <methods>] [--exclude-endpoints <methods>] [--url-prefix <prefix>] [--use-search] [--use-single] [--param <param>] [--type <type>]

Contributing

We welcome contributions to FlaskForge! If you have suggestions, improvements, or bug reports, please submit an issue or a pull request on our GitHub repository.

License

FlaskForge is licensed under the MIT License.

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

flaskforge-1.0.2.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

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

flaskforge-1.0.2-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

Details for the file flaskforge-1.0.2.tar.gz.

File metadata

  • Download URL: flaskforge-1.0.2.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for flaskforge-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4ff272cdea7bd4dbcad182f3bb4e00a7d50c3ec4abc0db83369c02c4683ca32a
MD5 b13b7b7f2ede51b5cfc1a02b329fedfd
BLAKE2b-256 b74a4d2a0b66811e78ef1b348f8d893608c7b28a172accf9dd506d261c774124

See more details on using hashes here.

File details

Details for the file flaskforge-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: flaskforge-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 60.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for flaskforge-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f5283e74c08eb309438c968c00bee12bbe6f53fe28a368f7bda77fc55c64098
MD5 2669a738d45219a1cf2caa5b3d944a6a
BLAKE2b-256 3f1469ede8c018754ec8f1367565c84d8c1f1cd20269eda0912977953b5afa9e

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