bdc_catalog.cli

bdc_catalog.cli.load_data(*args: Any, **kwargs: Any) Any

Command line to load collections and Items JSON into database.

Note

Make sure you have exported variable SQLALCHEMY_DATABASE_URI before like SQLALCHEMY_DATABASE_URI=postgresql://postgres:postgres@localhost/bdc.

Note

It skips collection that already exists. You must give at least --ifile or --from_dir parameter.

To load a single file JSON collection, use parameter -i or verbose --ifile path/to/json:

bdc-catalog load-data --ifile examples/fixtures/sentinel-2.json -v

The following output will be displayed:

Collection S2_L1C-1 created
-> Creating Item S2A_MSIL1C_20151122T132122_N0204_R038_T23LMF_20151122T132134
- Total 1 items created.

If you would like to read a directory containing several JSON collection files:

bdc-catalog load-data --from-dir examples/fixtures
Parameters:
  • ifile (str) – Path to JSON file. Default is None.

  • from_dir (str) – Readable directory containing JSON files. Defaults to None.

  • verbose (bool) – Display verbose output. Defaults to False.