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)
Development
Requirements
- pyenv (recommended)
- pipx (recommended)
- poetry
- nox
- nox-poetry
% pipx install poetry==1.1.7
% pipx install nox==2021.06.12
% pipx inject nox nox-poetry
Install
% git clone https://github.com/Informasjonsforvaltning/servicecatalogtordf.git
% cd servicecatalogtordf
% pyenv install 3.7.11
% pyenv install 3.8.11
% pyenv install 3.9.6
% pyenv local 3.7.11 3.8.11 3.9.6
% 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.0a11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0beecb0674975a64addcbb717860d82253422369c0921e131ee75393baba93a1 |
|
MD5 | 1c5b4ca048266ed937631f7d5af53a07 |
|
BLAKE2b-256 | 60e6b3e60c47c7058df883b20be6c903a559c3e015f84b8f024a6dd4815fb8c7 |
Close
Hashes for servicecatalogtordf-0.1.0a11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc5541cc2a6b620839330898fdddc79a7a0335f29a0f6ce090a38a5cd84d748a |
|
MD5 | a053e008ddefaf22b042457a97783210 |
|
BLAKE2b-256 | befde7c39c6b33ef760ca1e2fefb9f95138b8fe28995a5ebe33696a7ad0d045c |