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 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.2.tar.gz
(25.9 kB
view hashes)
Built Distribution
Close
Hashes for drb_metadata-1.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93dd680b01e8c783151e2e6941afc03f1abed54247ff410f1ca0deec7eaf962c |
|
MD5 | 371a8dc4cdc875b71752e997d5616473 |
|
BLAKE2b-256 | e2f50e408d1dbf7be7ba45d6cb07e15a808c37965af84c7b395a7de78839da04 |