Skip to main content

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_admin import Admin
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'] = False

db = SQLAlchemy(app)
admin = Admin(app, base_template='layout.html', template_mode='bootstrap3')
AutoCrud(db, app, admin=admin)

app.run(debug=True)

Go to http://127.0.0.1:5000/ and see all available resources with its endpoint

Configuration

  1. AUTOCRUD_METADATA_ENABLED: (default: True) enable metadata endpoint for a resource: <endpoint>/<resource>/meta

  2. AUTOCRUD_READ_ONLY: (default: False) enable only http GET method

  3. AUTOCRUD_BASE_URL: (default: ‘/’) prefix url for resources

  4. AUTOCRUD_SUBDOMAIN: (default: None) bind autocrud endpoints to a subdomain #

License MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-AutoCRUD-1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

Flask_AutoCRUD-1.0-py2-none-any.whl (7.9 kB view details)

Uploaded Python 2

File details

Details for the file Flask-AutoCRUD-1.0.tar.gz.

File metadata

  • Download URL: Flask-AutoCRUD-1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/2.7.15

File hashes

Hashes for Flask-AutoCRUD-1.0.tar.gz
Algorithm Hash digest
SHA256 b44550518149c6bfd2d83a2c3cc5b6cb12df27b40df0fcfae79fbc7424a5b817
MD5 bce0028d50d5a7990213867a90e7f28f
BLAKE2b-256 59a6b431ed82a360f8ebf546973a0892e67311394239b369e81b5582377d53de

See more details on using hashes here.

File details

Details for the file Flask_AutoCRUD-1.0-py2-none-any.whl.

File metadata

  • Download URL: Flask_AutoCRUD-1.0-py2-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/2.7.15

File hashes

Hashes for Flask_AutoCRUD-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 bc69a3ed392374956e75d69ead94ca290e6da9ddcfb391d1974c0594769bdc4e
MD5 99ec5c671f58610c9dfb36276b92510a
BLAKE2b-256 34fad5de14f9e1e4c0cf6231fd7a673613a830bf8d4acabb41968c52e911c30b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page