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 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
File details
Details for the file servicecatalogtordf-0.1.0a13.tar.gz
.
File metadata
- Download URL: servicecatalogtordf-0.1.0a13.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df3325e8ff0b98343b66088dde64f6f7bf4b606970933f4728e1b4ba7c37052 |
|
MD5 | adef599c79cf2cb0049b869f6f277f9f |
|
BLAKE2b-256 | d3142832c34a9d61c0c4aaa265067a02b8dca5a21cf4a69410894be1d580cfee |
File details
Details for the file servicecatalogtordf-0.1.0a13-py3-none-any.whl
.
File metadata
- Download URL: servicecatalogtordf-0.1.0a13-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48b83dcdb1e2b217a5e3089ff641426cb8a7554feef2827e6fe87e079742039 |
|
MD5 | 0c734152b8774a2a287a3cd34ed83e0f |
|
BLAKE2b-256 | 327f2c89062d79d13e9176c398559a88b0cfbfb56e063172bc48e171b48e0bda |