Create a Flask microservice with a few keystrokes
Project description
create-flask-service
Set up a Flask microservice with a few keystrokes
👶 Dependencies
🛠️ Installation
Install from PyPI using pip
, you may need to use pip3
depending on your installation
$ pip install create-flask-service
🚀 Usage
- Run the
create-flask-service
command - Enter your new project name, note that spaces will be converted to dashes
- Enter the root directory for your new project, if none is supplied then the current directory is used
- Watch the magic happen
That's honestly all there is to it!
📦 What's in the box
- Boilerplate directory structure. Adapted from a guide by AJ Pryor, author of the excellent flask_accepts library (included)
.
├── README.md
├── __init__.py
├── app.py
├── controller
│ └── __init__.py
├── database
│ └── __init__.py
├── interface
│ └── __init__.py
├── model
│ └── __init__.py
├── requirements.txt
├── schema
│ └── __init__.py
├── scripts
│ └── __init__.py
├── service
│ └── __init__.py
└── utils
└── __init__.py
- Python virtual environment with the following libraries installed, remember to activate the environment before developing
- flask - The Python micro framework for building web applications
- flask-restx - Fully featured framework for fast, easy and documented API development with Flask
- flask_accepts - Easy, opinionated Flask input/output handling mixing Marshmallow with flask-restx
- flask-compress - Compress responses in your Flask app with gzip
- flask-cors - Cross Origin Resource Sharing ( CORS ) support for Flask
- python-dotenv - Get and set values in your .env file in local and production servers
- marshmallow - A lightweight library for converting complex objects to and from simple Python datatypes
- python-jose - A JOSE implementation in Python
- werkzeug - The comprehensive WSGI web application library
- flask-sqlalchemy - The Database Toolkit for Python
- pyodbc - Python ODBC bridge
- typing-extensions
- Note that this is only needed for Python <3.7
- Basic Flask and Flask-RestX configuration
- app.py contains basic configuration setting up Flask, Flask-SQLAlchemy, CORS, and gzip compression
- controller/__init__.py contains basic Flask-RestX configuration based on the Flask-RestX guidelines
- Initialized git repository with a Python-specific .gitignore file
- Nothing will be committed automatically
- Basic README.md file
License
MIT © 2020 Andrew Mickael
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for create-flask-service-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b087ad71afb9defaab0f08a55212d2693de2b3519c591e0a8b4c325ee4388e |
|
MD5 | 4ea7e169a6c13dfec6074cd82f9a71cf |
|
BLAKE2b-256 | feeb4ec354cbb465292e94690dbac5a6fc3c39ea8aad0eb2862419935554292e |
Close
Hashes for create_flask_service-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2202b4ed69b3f88f20f17ac0f09cba4eec39902ec7bd203df6b132c4f4fd1489 |
|
MD5 | bbd4b2e8e4569b79cf1630374f8ca4bf |
|
BLAKE2b-256 | 30ba1cd69df3e86f3195be0595f90b6d6932ac4e7e49ba11d6da597cc368d592 |