Blueprints
Blueprints is a library to perform auto-discovery of Flask blueprints by scanning the installed packages for blueprints.txt files.
Discovery
Discovery of blueprints is performed by the register_blueprints method. All discovered blueprints are stored in a blueprints attribute of the blueprints package. The attribute is a dictionary containing the blueprint name and associated meta data.
If a blueprint has the url_prefix specified then it is used. Otherwise, the package name containing the blueprint is used as the url_prefix.
Installation
pip install --upgrade auto-blueprints
Running
Blueprints can be run as a module.
python -m blueprints
Blueprints can be run as a command line executable.
blueprints --host 127.0.0.1 --port 5000
If waitress is installed then a server using waitress is started. If waitress is not installed then the flask development server is started.
Embedding
Blueprints can be embedded in an existing program very simply.
from flask import Flask
from blueprints import register_blueprints
app = Flask(__name__)
register_blueprints('blueprints.txt', app)
app.run()
blueprints.txt format
The blueprints.txt file is a multi-line file containing one line per blueprint to import. The structure of the line is ...
hello.entry.bp => imports hello.entry and retrieves the bp attribute containing a flask blueprint
License
MIT Licensed
Release files for auto-blueprints 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| auto_blueprints-0.1.1.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_blueprints-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.0 kB
Release files / auto_blueprints-0.1.1.tar.gz
| Download URL | auto_blueprints-0.1.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da109c09cd29f2ed6451ecfcd0a8bf61858bc3a1c0b2c465ba12d04afe337c3d
|
|
BLAKE2b-256 checksum How to use checksums |
c5efcaa4ca56494b383a7c4fb6486c1da23b79e4de2035fb307129824debdb72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / auto_blueprints-0.1.1-py3-none-any.whl
| Download URL | auto_blueprints-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
029db087854f4636fbccbff0707919f4ce99239f506f9d7fea4318760ea97a02
|
|
BLAKE2b-256 checksum How to use checksums |
0b7006b0813f05db50d109b7f1c89b4ed10351d0fd5e5359f42431b60b418321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|