Skip to main content

A library containing modules for working with Digital Calibration Certificates (DCCs).

Project description

dcclib

A modular Python library for working with Digital Calibration Certificates (DCCs), complete with a CLI and REST API.


Overview

dcclib is a comprehensive monorepo that houses:

  • dcclib – Core library with essential tools for handling DCCs and other XML-based files.
  • dcclib-cli – Command Line Interface for quick access to library features.
  • dcclib-rest-api – RESTful API for integrating the library functionality into web services.

Whether you're converting, validating, or extracting information from DCCs, this library provides structured and reusable components to streamline your workflow.


Library Structure

Core Modules

  • conversion – Convert DCCs between various formats.
  • extraction – Extract key data like formulas and attachments.
  • signature – Verify and apply digital signatures.
  • validation – Validate structure and content of DCCs.
  • transformation – Apply XSLT transformations using stylesheets.

Abstract Interfaces

To promote consistency and reusability, the following abstract base classes define the common contract:

  • Constructible – Build from tree, file, or string (from_tree, from_file, from_str).
  • Convertible – Enable format conversion (convert).
  • Extractable – Extract structured information (extract).
  • Transformable – Apply transformations (transform).
  • Validatable – Validate trees, files, or strings (validate_tree, validate_file, validate_str).

Installation

Using pip

# Install from the GitLab package registry
pip install dcclib --index-url https://gitlab1.ptb.de/api/v4/projects/3323/packages/pypi/simple

# Include optional CLI tools
pip install "dcclib[cli]" --index-url https://gitlab1.ptb.de/api/v4/projects/3323/packages/pypi/simple

Using docker

# Login to the GitLab container registry
docker login registry.gitlab1.ptb.de

# Run the CLI in the current directory, replacing <command> with the desired command
docker run --rm -v $(pwd):/app registry.gitlab1.ptb.de/d-ptb/dcc/dcclib/cli:latest <command>

# Run the REST API on port 8080
docker run --rm -p 8080:8080 registry.gitlab1.ptb.de/d-ptb/dcc/dcclib/rest-api:latest

Development Setup

Requirements

  • Git
  • Python
  • uv (install via pipx install uv)

Getting Started

# Clone the repository
git clone https://gitlab1.ptb.de/ag1-24/sandbox/dcclib.git
cd dcclib

# Install dependencies
uv sync --all-packages

# Build all packages
uv build --all-packages

Commands

Run Components

# dcclib-rest-api
uv run --package dcclib-rest-api api

# dcclib-cli
uv run --package dcclib-cli cli

Run Tests

# dcclib
uv run -- pytest tests --cov=dcclib --cov-append

# dcclib-cli
uv run --package dcclib-cli -- pytest packages/dcclib-cli --cov=dcclib_cli --cov-append

# dcclib-rest-api
uv run --package dcclib-rest-api -- pytest packages/dcclib-rest-api --cov=dcclib_rest_api --cov-append

Lint and Format

# Lint all files and apply automatic fixes
uv run ruff check --fix

# Format all files
uv run ruff format

About

This project was developed as part of the bachelor thesis of Jan Loewe at the Ostfalia University of Applied Sciences.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dcclib-0.3.0-py3-none-any.whl (154.6 kB view details)

Uploaded Python 3

File details

Details for the file dcclib-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: dcclib-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 154.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for dcclib-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e86d4f12d483b4c0c2ee26e64715a2e1653cc9142320ea257b91489c886ed82
MD5 5ef92d655577253d48080a82acfefffe
BLAKE2b-256 f2ed8dc2909527dfe531dedfe7460f7ffe28fe4e402c28155d4406d61063b6ac

See more details on using hashes here.

Supported by

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