Skip to main content

xrdcore

The small, dependency-free core shared by xrdclient, xgfalclient and xrdarc. Nothing protocol-specific lives here, and nothing that needs a third-party package to import.

Module What it is
xrdcore.safexml fromstring() that refuses every <!DOCTYPE, so no entity can be declared, expanded or fetched (UnsafeXML).
xrdcore.checksum new("adler32"), checksum_bytes, checksum_file, algorithms(): one incremental, hashlib-shaped surface over Adler-32, CRC-32, CRC-32C, CRC-64/XZ, CRC-64/NVME, MD5 and the SHAs.
xrdcore.crc32c CRC-32C, hardware-assisted with the fast extra (google-crc32c), else crc32c_py.
xrdcore.crc64 CRC-64/XZ and CRC-64/NVME, pure Python.
xrdcore.log redact() and get_logger(): credential redaction for logs and terminals, and per-level mute(); configure() and verbosity_level(), a command-line tool's -v handler with that redaction.
xrdcore.cancel CancelScope (context-variable cancellation) and watching() (cancel hooks).
xrdcore.pipeline pump() and ReadAhead: the bounded, read-ahead byte pump every streamed copy ends in.
xrdcore.retry delay()/pause(): the one exponential, capped, deadline-aware, full-jitter backoff; retry_after() reads HTTP Retry-After in both spellings.
xrdcore.report The versioned storage-client-report document behind every tool's --json/--xml; parse() reads either format back as the one JSON tree.
xrdcore.errors The exception vocabulary xrdcore, xrdsec and xrdhttp raise. Clients join it: a client's same-meaning names are these classes (xrdclient.XRootDError is XrdError), and its own errors subclass them, by multiple inheritance where they are also a builtin.
xrdcore.fanout run_all(): jobs run side by side on threads, the first failure raised as itself (the rest noted on it), queued jobs never started and running ones told to stop (Stopped); each job sees the caller's contextvars. Pool: a long-lived, named pool for work that is not a fan-out, made on first use and again after a fork.
xrdcore.sockets recv_exact(): exactly N bytes from a framed stream socket, or ShortRead (an OSError) saying how far it got.
xrdcore.suggest suggestion(): the did you mean '-valid'? a mis-typed option, command or choice value gets, behind xrdcore.report.Parser.error, so every tool on the stack has it and nothing has to be configured.
xrdcore.cli ExitCode, the exit statuses every tool shares (0, 1, 2, 70, 130, 141), extends() for a tool's own table, run() (Ctrl-C → 130, a closed pipe → a quiet 141), Fatal (any other failure: one redacted prog: message line, its status from the tool's exit_code() table, a bug's traceback at DEBUG) and silence_stdout().

import xrdcore imports no submodule; each loads when first named.

from xrdcore import checksum, safexml

digest = checksum.new("adler32")
digest.update(b"hello world\n")
digest.hexdigest()            # '1e720467'

safexml.fromstring(b"<!DOCTYPE x><x/>")   # raises UnsafeXML

Development

In the workspace every package is installed editable into the shared interpreter, so the tests import the source tree. On a fresh checkout:

cd xrdcore
python -m pip install -e '.[dev,fast]'
python -m pytest -q -n 6 --cov=xrdcore      # 100 % line + branch, enforced (fail_under)
ruff check src tests && ruff format --check src tests
mypy                                        # strict, over src and tests
complexipy                                  # no function above 15, no snapshot
python -m build && twine check dist/*       # the wheel ships py.typed

Without the fast extra the CRC-32C tests still pass: they cover the pure-Python path, and the accelerated one through a stand-in module.

Licence

LGPL-3.0-or-later; see LICENSE and COPYING.

Metadata

Release files for xrdcore 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xrdcore 0.5.0
File Size Uploaded Provenance Actions
xrdcore-0.5.0.tar.gz 100.4 kB With provenance Details for xrdcore-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xrdcore 0.5.0
File Interpreter ABI Platform Actions
xrdcore-0.5.0-py3-none-any.whl Python 3 none any Details for xrdcore-0.5.0-py3-none-any.whl

Total release size: 171.4 kB

Release files / xrdcore-0.5.0.tar.gz

Download URL xrdcore-0.5.0.tar.gz
Size 100.4 kB
Tags Source
SHA-256 checksum
How to use checksums
65864c8b81e91a462f2fad8de8f7daf85c1091158e238d80f07e06d6bd263d5e
BLAKE2b-256 checksum
How to use checksums
28c4708581cc0c3e7c66f753f3f4f68d153de96499872ed13d1698116cd9a3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / xrdcore-0.5.0-py3-none-any.whl

Download URL xrdcore-0.5.0-py3-none-any.whl
Size 71.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28de25a58fea6a9b0c6c8ca6e2edd540bea8f5d2c49cbb7d40043a682dede092
BLAKE2b-256 checksum
How to use checksums
56678027e95c133e3192087319420e655e360cf7bd95f879fab8c2a9eea0d2fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for xrdcore 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xrdcore-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page