Skip to main content

DRB Metadata Extractor

Project description

DRB Metadata Extractor

It's an applicative part using DRB allowing to extract metadata from data according its topic.

Metadata

How to extract metadata ?

from drb.metadata import MetadataAddon
import drb.topics.resolver as resolver


if __name__ == '__main__':
    topic, node = resolver.resolve('<my_resource_url>')
    # topic keyword argument is not mandatory
    metadata = MetadataAddon().apply(node, topic=topic)
    for md_name, md in metadata.items():
        print(md_name, ' -- ', md.extract())

How to define metadata ?

Metadata are defined in a cortex.yaml file following the template:

drbItemClass: <topic_uuid>           # target topic
variables:                           # variable list
  - name: <var_name>                   # variable name
    <extractor>: <extractor_content>   # an extractor
metadata:                            # metadata list
  - name: my_metadata                  # metadata name
    <extractor>: <extractor_content>   # an extractor
  • metadata are applied to their target topic and its derivatives
  • inherited metadata is override if it's redefined in a derivative topic
  • variables are not transitive between a topic and its derivatives

Packaging

The package python containing metadata of a DRB topic must have the following instruction:

  • a drb.metadata entry point whose its value is the targeted Python package containing the cortex.yaml file

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

drb-metadata-1.3.2.tar.gz (25.9 kB view hashes)

Uploaded Source

Built Distribution

drb_metadata-1.3.2-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

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