A library that will map a service catalog (cpsv) to rdf
Project description
servicecatalogtordf
A library that will map a service catalog (cpsv) to rdf
The library contains helper classes for the following cpsv and related classes:
Usage
Install
% pip install servicecatalogtordf
Getting started
from datacatalogtordf import Catalog
from servicecatalogtordf import PublicOrganization, Service
# Create catalog object
catalog = Catalog()
catalog.identifier = "http://example.com/catalogs/1"
catalog.title = {"en": "A service catalog"}
catalog.publisher = "https://example.com/publishers/1"
# Create a service:
service = Service("http://example.com/services/1")
service.title = {"nb": "inntektsAPI", "en": "incomeAPI"}
# Create a public organization:
public_organization = PublicOrganization("https://example.com/publishers/1")
# Add it to the service:
service.has_competent_authority = public_organization
#
# Add service to catalog:
catalog.services.append(service)
# Get rdf representation in turtle (default)
rdf = catalog.to_rdf()
print(rdf.decode())
Development
Requirements
- pyenv (recommended)
- pipx (recommended)
- poetry
- nox
- nox-poetry
% pipx install poetry==1.1.6
% pipx install nox==2020.12.31
% pipx inject nox nox-poetry
Install
% git clone https://github.com/Informasjonsforvaltning/servicecatalogtordf.git
% cd servicecatalogtordf
% pyenv install 3.7.10
% pyenv install 3.8.8
% pyenv install 3.9.4
% pyenv local 3.7.10 3.8.8 3.9.4
% 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
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
Built Distribution
Close
Hashes for servicecatalogtordf-0.1.0a8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1572fdd0efd4a9a956b6f93b7f34d43941a3e5b257719c11a656fa4b3a6dcfd3 |
|
MD5 | f58fbc6950560a4dc34c4473ca5856db |
|
BLAKE2b-256 | 001642fdcd0eb35e3b407f394d3c9e833eb7602f84c5203d7b64112984dabb1a |
Close
Hashes for servicecatalogtordf-0.1.0a8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dfc156cf283b7dc4509e505891d35ccc06959cfc33c54dd6b561d14abb4c884 |
|
MD5 | c60ea2e4aa9133fd0b0db08c9b648bdf |
|
BLAKE2b-256 | 6f41e8da2a43a14a2caf86abbb367eff9c07cc488f37347d56b70608eb17ec29 |