No description
Find a file
2023-06-13 01:24:04 +00:00
campfire.py Adding the initial campfire script 2023-06-12 22:50:04 +00:00
README.md Update file README.md 2023-06-13 01:24:04 +00:00

campfire

This script autogenerates Flask MethodView resources and Marshmallow Schemas for a project that has a SQLAlchemy declarative model.

Requirements

In addition to flask-smorest, this project also requires the following:

  • Flask-JWT-Extended - for authentication
  • Flask-SQLAlchemy
  • Marshmallow-SQLAlchemy
  • SQLAlchemy

Expected Project Layout

/project_root
-   /package_name
    -   /models
    -   /views
        - /<collection_name>
            - resources.py
            - schemas.py
    app.py

- pyproject.toml

Assumptions

  • campfire.py is placed at the project_root
  • The models are importable from package_name.models
  • The SQLAlchemy class from Flask-SQLAlchemy is
    • instantiated
    • importable from package_name.models as db

Usage

Basic usage is simple

$ python campfire.py <package_name>