Skip to main content

Flask Endpoints for Database Import and Export

Project description

Flask Import/Export

Database import/export functionality for database stores under Flask

  1. Example Usage
  2. Options

Example Usage

from frappyflaskauth import check_login_state
from frappyflaskimpex import register_endpoints
from flask import Flask

app = Flask(__name__)
# create a dictionary of stores (key > AbstractMongoStore subclass)
stores = {}  
# register the endpoints
register_endpoints(app, stores, options={
    "permission": "impex",
    "login_check_function": check_login_state,
    "temp_folder": "_data/temp",
})

Options

Options for the register_endpoints function are:

  • api_prefix - default /api/impex - is the prefix under which the endpoints will be registered. This should match the prefix used in the front-end.
  • permission - default None - the permission required to manage imports and exports, if None is provided the user just needs to be logged in.
  • login_check_function - default None - provide a function that performs authentication and uses Flask's abort in case the login / permission check fails. The function has 1 parameter for the required permission. You can use check_login_state from the frappyflaskauth package.
  • temp_folder - default _temp - a folder path which will be used to temporarily store zip/json files used for import and export.

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

frappyflaskimpex-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

frappyflaskimpex-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file frappyflaskimpex-1.0.0.tar.gz.

File metadata

  • Download URL: frappyflaskimpex-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12

File hashes

Hashes for frappyflaskimpex-1.0.0.tar.gz
Algorithm Hash digest
SHA256 55d2c13aba75dbe536cbcfb3e7a879ac106cfb7d1aa1afa272bffd9fd7fe818e
MD5 f1ee012c30eddffccf06675412e880c0
BLAKE2b-256 044029790f656475b4d76f94a7852d666bcdf045df2bf3df594dc30e281e3a3f

See more details on using hashes here.

File details

Details for the file frappyflaskimpex-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: frappyflaskimpex-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12

File hashes

Hashes for frappyflaskimpex-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 455debfd5c995374faf786c61913fc135d7cedffd5434c98b2bbc0c320d58216
MD5 aca44e7b71fd2b51f8498f3f87b98f64
BLAKE2b-256 b1a90d185300e7cfc08e1d23216c57e0d8a175ea03942b39889c7db6745d1796

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