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)
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 thecortex.yaml
file
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(25.6 kB
view hashes)
Built Distribution
Close
Hashes for drb_metadata-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de356fbdb242090b0a2db35ca1eb925023503c63abdb83d72b3cba136efdfe93 |
|
MD5 | 8bd61fc6b31871727a80bea07f4fe99d |
|
BLAKE2b-256 | 4ded0f3fb9be56b47796c93ac2c33d2ccf036023b03e45ac26c5d97dd4b05ed9 |