flask_dbhydra
Autogenerate Flask API for dbhydra ORM DB structure. Allows to easily define with a simple dictionary what type of REST API operations should be allowed for tables in database + it is customizable.
flask_dbhydra_dict={'users':'read','items':'read'}
Installation
Use the package manager pip to install flask_dbhydra.
pip install flask_dbhydra
Usage
from flask import Flask
from flask_mysqldb import MySQL
from flask_cors import CORS
import dbhydra.dbhydra_core as dm
import flask_dbhydra.flask_dbhydra_core as flaskhydra
app = Flask(__name__)
db1=dm.Mysqldb("config.ini") #Need to specify connection parameters to MySQL DB
db1.close_connection()
app.config['MYSQL_USER'] = db1.DB_USERNAME
app.config['MYSQL_PASSWORD'] = db1.DB_PASSWORD
app.config['MYSQL_DB'] = db1.DB_DATABASE
app.config['MYSQL_CURSORCLASS'] = 'DictCursor'
app.config['JWT_SECRET_KEY'] = 'secret'
mysql = MySQL(app)
CORS(app)
TABLE_NAME="users"
item_name="item"
column1_name="column1"
column2_name="column2"
flask_dbhydra_dict={'users':'read','items':'read'}
flaskhydra.initialize_api(app,flask_dbhydra_dict,["name","data","item_name"],mysql,column1_name=column1_name)
app.run(debug=True)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Metadata
Release files for flask-dbhydra 0.1.7
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 | Actions |
|---|---|---|---|---|
| flask_dbhydra-0.1.7.tar.gz | 4.3 kB | Without provenance | Details for flask_dbhydra-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flask_dbhydra-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for flask_dbhydra-0.1.7-py3-none-any.whl |
Total release size: 9.1 kB
Release files / flask_dbhydra-0.1.7.tar.gz
| Download URL | flask_dbhydra-0.1.7.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
395d36a574e9130bec98409e5dfb18d93e043e443fccdf14c188ce66f990cb3e
|
|
BLAKE2b-256 checksum How to use checksums |
17031fe16c89ce5fb8b56c293c8521dff06c2d91e240bd285baf5f9c0c925445
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.12
|
Release files / flask_dbhydra-0.1.7-py3-none-any.whl
| Download URL | flask_dbhydra-0.1.7-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd4fb87dfbe81759c5dd024f0a31aa5ad248b2affd963d9ef3dbf18f4a1c92e7
|
|
BLAKE2b-256 checksum How to use checksums |
1b06ae35135b509cc32fa49caf31a49d801e7542c27c56e51a3abb6a6c87db1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.12
|
Security for flask-dbhydra 0.1.7
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.