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.contains_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 locally
% git clone https://github.com/Informasjonsforvaltning/servicecatalogtordf.git
% cd servicecatalogtordf
% pyenv install 3.8.12
% pyenv install 3.9.10
% pyenv local 3.8.12 3.9.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
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.0a14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a38ef7f7e4802eae1d98a0ba76f629d4808f499cf519a62c84632ff7a21b67 |
|
MD5 | ef83f980710162a086731dc544b72963 |
|
BLAKE2b-256 | 0055001cdf33f9b15f45f6ffda7edfa4601fdff5e189b617a165e29402e09ee5 |
Close
Hashes for servicecatalogtordf-0.1.0a14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef48abcdef73afdf86a905b62d7f028a4f94b2eaa60c65a6352dd6ac35618064 |
|
MD5 | 6298665feed8cb88a9108571afd4c915 |
|
BLAKE2b-256 | a01cbd6b744a7369ee23c4f7e287df69ef50e7d2cbb1173c18342bfcc6f97113 |