Skip to content

Informasjonsforvaltning/fdk-rdf-parser-service

Repository files navigation

fdk-rdf-parser-service

A Python service that parses RDF data to JSON.

Developing

Requirements

Install software

pyenv install 3.11.8
pyenv local 3.11.8
pip install poetry==1.7.1
pip install nox==2024.3.2
pip install nox-poetry==1.0.3
poetry install

Running the service locally

poetry run uvicorn fdk_rdf_parser_service.app:app --reload --port 8080 --env-file .env.development

Running the service locally with docker

docker compose up -d
poetry shell
curl localhost:8080/ping
curl localhost:8080/ready
# Assuming you are in project root:
curl -X POST \
    --header "Content-Type: text/turtle" \
    --header "X-API-KEY: test-key" \
    --header "Accept: application/json" \
    --upload-file ./tests/data/dataset0.ttl \
    localhost:8080/dataset

OpenAPI

Generated by utility session in nox:

nox -s openapi

View in browser (when app is running locally) localhost:8080/openapi.json

Testing

Running tests

All tests

nox

Unit tests

nox -s unit_tests

Integration tests

nox -s integration_tests

Contract tests

nox -s contract_tests

Verbose mode

Verbose output from sessions for debugging

nox -s tests -- -vvv

Other helpful commands

Linter

nox -s lint

Static type checking

nox -s mypy

Formatting

nox -s format

Clear py-cache

nox -s cache

Run tests outside of a nox session:

poetry run pytest

Run session with specified arguments:

nox -s tests -- -vv

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published