STAC Generator

View on Github

This library aims to be a generic tool for extracting meta data. This meta dat can then be mapped into the STAC framework to generate STAC-like items and collections.

You should be able to generate content which contains all the relevant information to allow you to construct a valid STAC item.

This library works on the premise that you can build a processing workflow for each of your datasets by chaining together different extraction methods to extract and manipulate the relevant information. The core facet extraction chain works on an atomic basis, where input plugins provide a single object for inspection and output a single object.

Read the Orientation guide as a introduction into the framework.

Installing

pip install stac-generator

Usage

There is a console script defined by this package which can be used to run the extractors stac_generator.

usage: stac_generator [-c] path/to/conf

Run the STAC Generator as configured

required arguments:
  -c        Path to a yaml configuration file

optional arguments:
  -h, --help  show this help message and exit

Configuration

The configuration file feeds this top level script and configures the inputs/outputs as well as the generator.

Base configuration options:

Option

Description

generator

The generator type item or collection

recipes_root

REQUIRED Path to the root directory for the recipes. Used to describe workflows.

inputs

REQUIRED Must have at least one input.

outputs

REQUIRED Must have at least one output.

extraction_methods

OPTIONAL Defaults for any extraction methods that are being used :ref:`extraction methods <stac_generator/extraction_methods>`_.

logging

Kwargs passed to the logging.basicConfig setup method

The generator can be specified in the configuration file or can be loaded from an entry point. The configuration value takes precedence over entry points.

Warning

Only the first generator will be loaded from entry points.

Sample configuration

generator: item

recipe_root: example/recipes

inputs:
  - method: file_system
    path: /badc/faam/data/2005/b069-jan-05

outputs:
  - method: standard_out

logging:
   level: INFO

Plugins

Plugins are used to add modular components and allow extension of the base capabilities to fit your needs. The range of different Inputs, Outputs, Extraction Methods, and Mappings have been developed to meet different use cases.