Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
app Implement schematic_package schematic Aug 17, 2019
entity Implement entity schematic Aug 18, 2019
flask-plotly Remove a file Aug 26, 2019
schematic Fix a test that was rendering a local directory Aug 31, 2019
setup Remove a print statement Sep 1, 2019
README.md Update README Aug 26, 2019
__init__.py Update parsing login Aug 10, 2019

README.md

Schematics built into flaskerize

The following is a summary/description of the various schematics that ship with flaskerize itself

Entity

An entity is a combination of a Marshmallow schema, type-annotated interface, SQLAlchemy model, Flask controller, and CRUD service as described in this blog post. It contains tests and provides functionality for being registered within an existing Flask application via its register_routes method in `init.py.

Additional parameters:

  • None (only uses the default/required name parameter)

Example Usage

The command fz generate entity path/to/my/doodad would produce an entity with the following directory structure.

Note: the current version of flaskerize generates the code for an Entity, but does not yet automatically wire it up to an existing application, configure routing, etc. That will come soon, but for now you will need to make that modification yourself. To do so, invoke the register_routes method from the entity's __init__py file from within your application factory. For more information, check out a full working example project here.

path
└── to
    └── my
        └── doodad
            ├── __init__.py
            ├── controller.py
            ├── controller_test.py
            ├── interface.py
            ├── interface_test.py
            ├── model.py
            ├── model_test.py
            ├── schema.py
            ├── schema_test.py
            ├── service.py
            └── service_test.py

Schematic

Flaskerize would be remiss if there was not a schematic for generating new, blank schematics.

Additional parameters:

  • None (only uses the default/required name parameter)

Example Usage

The command fz generate schematic path/to/schematics/new_schematic would produce a new schematic with the following directory structure.

path
└── to
    └── schematics
        └── new_schematic
            ├── custom_functions.py
            ├── files
            ├── new_schematic
            ├── run.py
            └── schema.json

flask-plotly

A basic Flask app that renders a plotly chart via a blueprint

Example usage

fz generate flask-plotly my_app/
cd my_app
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
python wsgi.py

Creates:

my_app
├── app
│   ├── __init__.py
│   ├── config.py
│   ├── main
│   │   ├── __init__.py
│   │   └── view.py
│   └── templates
│       ├── base.html
│       └── plotly-chart.html
├── requirements.txt
└── wsgi.py

setup

setup creates a setup.py file.

Additional parameters:

    {
      "arg": "--version",
      "type": "str",
      "default": "0.1.0",
      "help": "Current project version"
    },
    {
      "arg": "--description",
      "type": "str",
      "default": "Project built by Flaskerize",
      "help": "Project description"
    },
    {
      "arg": "--author",
      "type": "str",
      "help": "Project author"
    },
    {
      "arg": "--author-email",
      "type": "str",
      "help": "Project author"
    },
    {
      "arg": "--url",
      "type": "str",
      "default": "https://github.com/apryor6/flaskerize",
      "help": "Project website / URL"
    },
    {
      "arg": "--install-requires",
      "type": "str",
      "nargs": "+",
      "help": "Requirements"
    }

Example Usage

fz generate setup demo/doodad

Creates the following directory structure:

demo
└── setup.py

Where the contents of setup.py correspond to a new package named "doodad"

You can’t perform that action at this time.