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-servicecommand - 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
To start the application run app.py and navigate to http://127.0.0.1:5000, you should see a blank Swagger UI page. Note that in certain IDEs like PyCharm you may need to set your working directory to the project root, this will ensure that the .env file is loaded before runtime.
⚙️ Command Line Arguments
Note that supplying arguments will not run the main program
| Name | Argument | Description | Default |
|---|---|---|---|
| Version | -V | Display installed version number | False |
📦 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
- pytest - The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
- 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
- Boilerplate code style is formatted with Black, but you may use whatever style suits you
- Initialized git repository with a Python-specific .gitignore file
- Nothing will be committed automatically
- Basic README.md file
⚖️ License
Metadata
Release files for create-flask-service 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| create-flask-service-0.1.6.tar.gz | 9.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| create_flask_service-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.9 kB
Release files / create-flask-service-0.1.6.tar.gz
| Download URL | create-flask-service-0.1.6.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ea4c56278b40dbe070e5635a3ec76581ce14a53c1029bfa461cd98973cecaa9
|
|
BLAKE2b-256 checksum How to use checksums |
43ae5d1db599b69e1a157e4859bddc62786f9b234519db6472ac415c4462d60f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
|
Release files / create_flask_service-0.1.6-py3-none-any.whl
| Download URL | create_flask_service-0.1.6-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33cb6eb0e1f61e5665f16057ccadbb24f718c09404091a6fe69344e0227d42a4
|
|
BLAKE2b-256 checksum How to use checksums |
18649f6da6527b2c189b05c2164be7621155cbf2e21ec981f325ea253aaff8f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
|
Security for create-flask-service 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.