Automatically generate a RESTful API service for CRUD operation on database
Project description
Based on sandman2.
Automatically generate a RESTful API service for CRUD operation on database. If a list of tables or a list of sqlalchemy model is not provided, all tables are affected.
For api documentation see sandman2 documentation
Quickstart
Install flask_autocrud using pip:
$ pip install Flask-AutoCRUD
Example usage
from flask import Flask
from flask_autocrud import AutoCrud
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite+pysqlite:///db.sqlite3'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['AUTOCRUD_METADATA_ENABLED'] = True
db = SQLAlchemy(app)
AutoCrud(app, db)
app.run(debug=True)
Go to http://127.0.0.1:5000/ and see all available resources with its endpoint. NOTE: you must set SQLALCHEMY_DATABASE_URI with your database.
If you want to see an example use with Flask-Admin see in example folder.
Configuration
AUTOCRUD_METADATA_ENABLED: (default: True) enable metadata endpoint for a resource: <endpoint>/<resource>/meta
AUTOCRUD_READ_ONLY: (default: False) enable only http GET method
AUTOCRUD_BASE_URL: (default: ‘/’) prefix url for resources
AUTOCRUD_SUBDOMAIN: (default: None) bind autocrud endpoints to a subdomain #
License MIT
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
File details
Details for the file Flask-AutoCRUD-1.1.0.tar.gz
.
File metadata
- Download URL: Flask-AutoCRUD-1.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4135a256f4bfbf077fff2d152a254e34ba43ef455e361562cd97bd80a708aa9e |
|
MD5 | 9952cc96f55040c31b2f6147a633b856 |
|
BLAKE2b-256 | 76e943361556ae85527bcf32e394093f2f6a50c59ca7684956a1e56cc322903a |
File details
Details for the file Flask_AutoCRUD-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: Flask_AutoCRUD-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e97e7655990e741b74731027bc2f5bcdcdc77fabc4e8701f927665a73f4580f2 |
|
MD5 | ca1c611456a95a01330cb23130c33751 |
|
BLAKE2b-256 | bee27a19e7b321c0a965eb529ec7273598e66587d71ae9117904d4e5ba28a2c7 |