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 details)
Built Distribution
File details
Details for the file drb-metadata-1.3.2.tar.gz
.
File metadata
- Download URL: drb-metadata-1.3.2.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34df8939eeb1a650dafed3b4c1ed1c19378be040baa63edfd9a3fbbc1037136 |
|
MD5 | 415e730155e3015944ed3bd7fbd22145 |
|
BLAKE2b-256 | 600bded708f22d52491ff897bdffb586abbb9827b41384a1f3375cd90ad30d10 |
File details
Details for the file drb_metadata-1.3.2-py3-none-any.whl
.
File metadata
- Download URL: drb_metadata-1.3.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93dd680b01e8c783151e2e6941afc03f1abed54247ff410f1ca0deec7eaf962c |
|
MD5 | 371a8dc4cdc875b71752e997d5616473 |
|
BLAKE2b-256 | e2f50e408d1dbf7be7ba45d6cb07e15a808c37965af84c7b395a7de78839da04 |