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
File details
Details for the file servicecatalogtordf-0.1.0a9.tar.gz
.
File metadata
- Download URL: servicecatalogtordf-0.1.0a9.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.4.0-1047-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9773bbf1390b7859f4652ab693bc397b9dc84e0d3c7a8f35d5af23a8a2ccea6 |
|
MD5 | 0ec88ac18473277d40cc31e85464b7bf |
|
BLAKE2b-256 | 1f4141661dd446034005a8f34ee643da7112530dcb85f62e794f05bd82a73214 |
File details
Details for the file servicecatalogtordf-0.1.0a9-py3-none-any.whl
.
File metadata
- Download URL: servicecatalogtordf-0.1.0a9-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.4.0-1047-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80e47e8da350b643b13855231c1e127f877a9f81715392bed46322c0d63a1882 |
|
MD5 | ed0da7c682433a672ac0192fd42c7401 |
|
BLAKE2b-256 | fb4dcecbaa94ef9e9f0b9c152216090444a55c4ceab5cd8d8bc3287b05fe453e |