A library for managing DCAT metadata using Apache Atlas
Project description
atlasdcat
A Python library for mapping Apache Atlas Glossary terms to DCAT metadata and vice versa.
Specification the Norwegian Application Profile of the DCAT standard.
Usage
Install
% pip install atlasdcat
Getting started
# Example...
from atlasdcat import AtlasDcatMapper
from pyapacheatlas.auth import BasicAuthentication
from pyapacheatlas.core.glossary import GlossaryClient
atlas_auth = BasicAuthentication(username="dummy", password="dummy")
atlas_client = GlossaryClient(
endpoint_url="http://atlas", authentication=atlas_auth
)
mapper = AtlasDcatMapper(
glossary_client=atlas_client,
glossary_id="myglossary",
catalog_uri="https://domain/catalog",
catalog_title="Catalog",
catalog_publisher="https://domain/publisher",
dataset_uri_template="http://domain/datasets/{guid}",
distribution_uri_template="http://domain/distributions/{guid}",
language="en",
)
try:
catalog = mapper.map_glossary_to_dcat_dataset_catalog()
print(catalog.to_rdf())
except Exception as e:
print(f"An exception occurred: {e}")
Development
Requirements
% pip install poetry==1.1.13
% pip install nox==2022.1.7
% pip inject nox nox-poetry==1.0.0
Install developer tools
% git clone https://github.com/Informasjonsforvaltning/atlasdcat.git
% cd atlasdcat
% pyenv install 3.8.12
% pyenv install 3.9.10
% pyenv install 3.10.
% pyenv local 3.8.12 3.9.10 3.10.
% poetry install
Run all sessions
% nox
Run all tests with coverage reporting
% nox -rs tests
Debugging
You can enter into Pdb by passing --pdb
to pytest:
nox -rs tests -- --pdb
You can set breakpoints directly in code by using the function breakpoint()
.
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
atlasdcat-1.0.0.tar.gz
(10.9 kB
view hashes)
Built Distribution
atlasdcat-1.0.0-py3-none-any.whl
(11.1 kB
view hashes)
Close
Hashes for atlasdcat-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb86ac3ad20cc43af75c9c595eaccf8efd8f9e4396dddf642b47a014ff89406a |
|
MD5 | 00a449dc900ebdb8583a5ee35439cd77 |
|
BLAKE2b-256 | 821cefc0319939032a143ca4cf4c13bfde3dfae6852547470fe89789187112a4 |