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_language="http://publications.europa.eu/resource/authority/language/NOB",
catalog_title="Catalog",
catalog_publisher="https://domain/publisher",
dataset_uri_template="http://domain/datasets/{guid}",
distribution_uri_template="http://domain/distributions/{guid}",
language="nb",
)
try:
catalog = mapper.map_glossary_to_dcat_dataset_catalog()
print(catalog.to_rdf())
except Exception as e:
print(f"An exception occurred: {e}")
For an example of usage of this library in a simple server, see example.
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.1.tar.gz
(11.8 kB
view hashes)
Built Distribution
atlasdcat-1.0.1-py3-none-any.whl
(11.5 kB
view hashes)
Close
Hashes for atlasdcat-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a072c26f0a1164da7183ad19dc4eb1d202eef48af6397fd6ac96ccebd14bb3e4 |
|
MD5 | a10aceca6ed1c10c65be99f8edf351eb |
|
BLAKE2b-256 | 212c953bd6effb91be262f5494f476f02ba751d25b9c20ac05d8c027406f40b3 |