libdc3
Library designed to implement all operations needed for DC3 application and at the same time be human-usable through python scripts or notebooks.
Installation
To install libdc3, simply
$ pip install libdc3
Environment variables
This library depends heavily on runregistry python package, so it is needed to set SSO_CLIENT_ID and SSO_CLIENT_SECRET in your environment.
The interface with brilcalc is done via SSH or standard python subprocess if brilconda environment is available under the /cvmfs location. If executing in an environment without brilconda, you need to configure the dc3_config object with your LXPlus credentials (recommended via environment variables).
Last but not least, in order to successfully communicate with DQMGUI and T0 endpoints a valid CERN Grid certificate is needed. Again, the dc3_config object should be configured with paths to the grid certificated and key (that should be opened).
SWAN setup
- Configure your SWAN environment using
Software stack 105aand select the optionUse Python packages installed on CERNBox - Create a SWAN project with any name you like and upload all example notebooks to it
- Open SWAN terminal and create a
.envfile under your project directory and add the following variables:SSO_CLIENT_ID,SSO_CLIENT_SECRET,AUTH_CERT,AUTH_CERT_KEY - On any notebook, create a new cell and add
pip install libdc3.
Development
Install the dependencies and the package using uv:
uv sync --all-groups
uv run pre-commit install
uv pip install -e .
Running tests
Run tests with pytest:
uv run pytest tests
Tox
Tox is pre-configured in tox.ini, so you can run the following to test against multiple python versions locally:
uv run tox
asdf users
tox requires multiple versions of Python to be installed. Using asdf, you have multiple versions installed, but they aren’t normally exposed to the current shell. You can use the following command to expose multiple versions of Python in the current directory:
asdf set python 3.12.9 3.11.10 3.10.13 3.9.19
This will use 3.12.9 by default (if you just run python), but it will also put python3.11, python3.10 and python3.9 symlinks in your path so you can run those too (which is exactly what tox is looking for).
Releasing the package on PyPI
The package is available in PyPI at libdc3, under the cmsdqm organization. You'll need at leat Mantainer rights to be able to push new versions.
CI
Do not worry. The GitLab CI is configured to automatically publish the package on PyPI and the release notes in GitLab whever a tag is pushed to the repo.
[!NOTE] For this to work the CI/CD variables named
UV_PUBLISH_TOKEN,GITLAB_TOKENshould be registered in gitlab. TheUV_PUBLISH_TOKENis a api token access of CMSDQM organization and theGITLAB_TOKENis a Project Access Token with api read/write rights, which is needed to read merge requests using theglab-cli. https://gitlab.cern.ch/cms-dqmdc/libraries/python-libdc3/-/settings/access_tokens
Manual
If you want to follow the manual approach, you need to first build and then publish.
Build
You can use uv to build the package using:
uv build
The build system will automatically update the package version based on the git tag of the current commit.
Publish
Provided you have already generate a PyPI api token in your account or in CMDQM org, you can publish using:
UV_PUBLISH_TOKEN=... uv publish
Metadata
Release files for libdc3 1.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| libdc3-1.3.3.tar.gz | 828.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libdc3-1.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.6 MB
Release files / libdc3-1.3.3.tar.gz
| Download URL | libdc3-1.3.3.tar.gz |
|---|---|
| Size | 828.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38501aba36b82f54336b7ff3067a8e9bb509a483558bce6447a753d81207c3ce
|
|
BLAKE2b-256 checksum How to use checksums |
d26baffe80ec59bf84ef9be8e526cfc4c093fedf1fcdf8f1a066634127f23a20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / libdc3-1.3.3-py3-none-any.whl
| Download URL | libdc3-1.3.3-py3-none-any.whl |
|---|---|
| Size | 803.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de2559679792d237049a1f68a27df484cf5e5129635b0049c483c2534fc9d030
|
|
BLAKE2b-256 checksum How to use checksums |
5119377a7b835f111a1f6edc6c92f2e7236dfdd08e5d56de62563f7e231e092b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for libdc3 1.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.