Metadata-Version: 2.5
Name: dcclib
Version: 0.4.0
Summary: A library containing modules for working with Digital Calibration Certificates (DCCs).
Author-email: Jan Loewe <jan.loewe@ptb.de>, Justin Sebastian Jagieniak <justin.jagieniak@ptb.de>
License-Expression: LGPL-3.0-or-later
License-File: LICENSE
Keywords: DCC,Digital Calibration Certificate,PTB
Requires-Python: <3.15,>=3.11
Requires-Dist: dcc-json-toolkit>=1.2.3
Requires-Dist: lxml>=6.1.3
Requires-Dist: mpmath>=1.3.0
Requires-Dist: prettytable>=3.18.0
Requires-Dist: rich>=15.0.0
Requires-Dist: saxonche>=13.0.0
Requires-Dist: signxml>=5.1.0
Requires-Dist: sympy>=1.14.0
Provides-Extra: cli
Requires-Dist: dcclib-cli; extra == 'cli'
Provides-Extra: mcp
Requires-Dist: dcclib-cli[mcp]; extra == 'mcp'
Provides-Extra: quantities
Requires-Dist: dccquantities>=3.0.2; extra == 'quantities'
Requires-Dist: pythonnet>=3.1.0; extra == 'quantities'
Description-Content-Type: text/markdown

<div align="center">
  <img src="docs/assets/dcclib.png" alt="dcclib logo" width="200px"/>
  <h1>dcclib</h1>
  <p>A modular Python library for working with Digital Calibration Certificates (DCCs), complete with a CLI and REST API.</p>
  <h3>
    [Documentation](https://gitlab-pages.ptb.de/d-ptb/dcc/dcclib/) | [Releases](https://gitlab1.ptb.de/d-ptb/dcc/dcclib/-/releases) | [Issues](https://gitlab1.ptb.de/d-ptb/dcc/dcclib/-/issues)
  </h3>
</div>

[[_TOC_]]

---

## 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.

> **Full documentation** (architecture overview, CLI reference, REST API docs, and API reference) is available at
> the [project documentation site](https://gitlab-pages.ptb.de/d-ptb/dcc/dcclib).

---

## Installation

### Using `pip`

```bash
# Install the library in a virtual environment
pip install dcclib

# or install the CLI globally
pipx install "dcclib[cli]"
# with MCP support for AI agents
pipx install "dcclib[cli,mcp]"
# and with unit-aware quantities support using dccQuantities (requires .NET on Windows and libmono on Linux)
pipx install "dcclib[cli,quantities]"
# and everything for the full experience
pipx install "dcclib[cli,mcp,quantities]"
```

### Using `docker`

```bash
# 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
- `mise` (install via `curl https://mise.run | sh`), optional but recommended
- Python (via mise)
- `uv` (via mise)

### Getting Started

```bash
# Clone the repository
git clone https://gitlab1.ptb.de/d-ptb/dcc/dcclib.git
cd dcclib

# Install all dependencies
mise run setup # or: uv sync --all-packages
```

Run `mise tasks ls` for the full list of available tasks. Common ones:

| Task                  | Description                                    |
|-----------------------|------------------------------------------------|
| `mise run test`       | Full test suite                                |
| `mise run lint`       | Lint with auto-fix                             |
| `mise run format`     | Format all files                               |
| `mise run run:cli`    | Start the CLI                                  |
| `mise run run:api`    | Start the REST API                             |
| `mise run docs:serve` | Live-preview the docs at http://localhost:8000 |
| `mise run docs:build` | Build the docs into `public/`                  |

---

## Publications and acknowledgments

This project was developed as part of the bachelor thesis of Jan Loewe at the Ostfalia University of Applied Sciences.  
More information on dcclib itself can be found in the presentation by Jan Loewe and Justin Jagieniak [at the 6th International DCC Conference in 2026][1].  
The formula module is based on previous work conducted by Justin Jagieniak, Siegfried Hackel and Jan Loewe [first presented at the 5th International DCC Conference in 2025][2].  
Automatic uncertainty propagation is implemented using [dccQuantities](https://gitlab1.ptb.de/digitaldynamicmeasurement/dcc-and-dsi/dccQuantities) which internally relies on [METAS UncLib](https://www.metas.ch/metas/en/home/fabe/hochfrequenz/unclib.html).  
dccQuantities was also [presented at the 6th International DCC Conference][1] by Jaime Gonzalez-Gomez, Benedikt Seeger and Vanessa Stehr.

[1]: https://oar.ptb.de/resources/show/10.7795/810.20260312
[2]: https://oar.ptb.de/resources/show/10.7795/810.20250619
