Skip to content

Latest commit

 

History

236 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandible

Test

A generic framework for writing satellite data ingest systems

Installing

Mandible can be installed from GitHub using pip.

$ pip install git+https://github.com/asfadmin/mandible@v0.8.0

To install with all extra dependencies:

$ pip install git+https://github.com/asfadmin/mandible@v0.8.0#egg=mandible[all]

To install the latest development version:

$ pip install git+https://github.com/asfadmin/mandible

Features

Templated metadata extraction

The metadata mapper is used to extract metadata from one or more source files and insert it into a JSON style template.

Example:

from mandible.metadata_mapper import (
    ConfigSourceProvider,
    Context,
    MetadataMapper,
)

mapper = MetadataMapper(
    template={
        "polarization": {
            "@mapped": {
                "source": "met.json",
                "key": "Polarization",
            },
        },
    },
    source_provider=ConfigSourceProvider(
        {
            "met.json": {
                "storage": {
                    "class": "LocalFile",
                    "filters": {
                        "name": r".*\.met\.json",
                    },
                },
                "format": {
                    "class": "Json",
                },
            },
        }
    ),
)
context = Context(
    files=[
        {
            "name": "my-granule.met.json",
            "path": "/tmp/ingest/my-granule.met.json",
        }
    ]
)

mapper.get_metadata(context)
# Returns an object that looks like the template with values replaced
# {"polarization": "VV"}

About

A generic framework for writing satellite data ingest systems

Resources

Stars

4 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages