Skip to main content

A library that will map a service catalog (cpsv) to rdf

Project description

Tests codecov PyPI Read the Docs

servicecatalogtordf

A library that will map a service catalog (cpsv) to rdf

The library contains helper classes for the following dcat classes:

Usage

Install

% pip install servicecatalogtordf

Getting started

from datacatalogtordf import Catalog
from servicecatalogtordf import 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

% 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

servicecatalogtordf-0.1.0a4.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

servicecatalogtordf-0.1.0a4-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file servicecatalogtordf-0.1.0a4.tar.gz.

File metadata

  • Download URL: servicecatalogtordf-0.1.0a4.tar.gz
  • Upload date:
  • Size: 9.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

Hashes for servicecatalogtordf-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 b165c9b407d0535c3d053f60de1e59a22be7617dac2bb296f3d850dfac92d9e2
MD5 9ff48fa4340112ed0ade53ce919a144b
BLAKE2b-256 32342fab9e7bd6fe6ad38d3cb4313ae9a76abc7f6bd2f0a6ccf21ee08caac2f5

See more details on using hashes here.

File details

Details for the file servicecatalogtordf-0.1.0a4-py3-none-any.whl.

File metadata

File hashes

Hashes for servicecatalogtordf-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 8a4628906cadd2f518ee3c00578f2d91dd498a462352d6b6b493f6497a6ef556
MD5 a3e6dc8ae63d4f92e01e5a1ca58e1411
BLAKE2b-256 b865a3d342939b87050c05995c510efe1de0461bafc00727dd035692baea94c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page