API
Image catalog extension for Brazil Data Cube applications and services.
You can initialize this extension as following:
from flask import Flask
from bdc_catalog import BDCCatalog
app = Flask(__name__)
with app.app_context():
ext = BDCCatalog(app)
To see all models offered by BDC-Catalog module, navigate to bdc_catalog.models
.
Image catalog extension for Brazil Data Cube applications and services.
- class bdc_catalog.ext.BDCCatalog(app=None)
Image catalog extension.
Examples
>>> from flask import Flask >>> app = Flask(__name__) >>> catalog = BDCCatalog(app) >>> db = catalog.db >>> with app.app_context(): >>> db.session.execute('SELECT 1')
When the
BDC-Catalog
is loaded, the module make available a command linebdc-catalog
with the following resources:Usage: bdc-catalog [OPTIONS] COMMAND [ARGS]... Database commands. .. note:: You can invoke more than one subcommand in one go. Options: -e, --env-file FILE Load environment variables from this file. python- dotenv must be installed. -A, --app IMPORT The Flask application or factory function to load, in the form 'module:name'. Module can be a dotted import or file path. Name is not required if it is 'app', 'application', 'create_app', or 'make_app', and can be 'name(args)' to pass arguments. --debug / --no-debug Set debug mode. --version Show the Flask version. --help Show this message and exit. Commands: alembic Perform database migrations. db More database commands. instance Instance commands. lccs More lccs database commands. load-data Command line to load collections JSON into database. routes Show the routes for the app. run Run a development server. shell Run a shell in the app context.
You may proceed to the bdc_catalog.cli to see all supported command lines.
- property db: SQLAlchemy
Retrieve instance Flask-SQLALchemy instance.
Notes
Make sure to initialize the BDCCatalog before.
- init_app(app: Flask, **kwargs)
Initialize Flask application instance.
- Parameters:
app – Flask application