Skip to main content

xrdsum

XrootD plugin for calculating checksums and storing them in extended attributes. Currently supports ADLER32 checksum and HDFS as backend. Borrows heavily from cephsum plugin.

This plugin is designed to easily accommodate new checksum types and backends. Additional dependencies for backends are defined as optional dependencies for the package (see usage instructions).

Actions Status Documentation Status Code style: black

PyPI version PyPI platforms

GitHub Discussion Gitter

Usage

xrdsum requires Python version >=3.8. To install, run:

pip install xrdsum[hdfs]
xrdsum --help
Usage: xrdsum [OPTIONS] COMMAND [ARGS]...

  Callback to give the --verbose and --debug options to all commands

Options:
  -v, --verbose         Verbose output
  -d, --debug           Debug output
  -l, --log-file TEXT   Log file
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  --help                Show this message and exit.

Commands:
  get     Get the checksum of a file.
  verify  Check if a file has the correct checksum.

Example:

/usr/bin/time -v xrdsum --verbose  --debug get  /xrootd/dteam/user/jwalder/file_1GB_020 --read-size 128

xrootd config

# ensure cksum adler32 is included in the tpc directive, in order to calculate by default on transfer
ofs.tpc cksum adler32 fcreds ?gsi =X509_USER_PROXY autorm xfr 40 pgm /etc/xrootd/xrdcp-tpc.sh

# add this line to trigger external checksum calculation. Would be overwritten by other xrootd.chksum lines
xrootd.chksum max 50 adler32 /etc/xrootd/xrdsum.sh

with /etc/xrootd/xrdcp-tpc.sh containing:

#!/bin/sh

# from https://github.com/snafus/cephsum/blob/master/scripts/xrdcp-tpc.sh
#Original code
#/usr/bin/xrdcp --server -f $1 root://$XRDXROOTD_PROXY/$2

# Get the last two variables as SRC and DST, all others are assumed as additional arguments
OTHERARGS="${@:1:$#-2}"
DSTFILE="${@:$#:1}"
SRCFILE="${@:$#-1:1}"


/usr/bin/xrdcp $OTHERARGS --server -f $SRCFILE root://$XRDXROOTD_PROXY/$DSTFILE

and with /etc/xrootd/xrdsum.sh containing:

#!/usr/bin/env bash

RESULT=$(xrdsum get --store-result --chunk-size 64 --verbose --storage-catalog /etc/xrootd/storage.xml "$1")
ECODE=$?

# XRootD expects return on stdout - checksum followed by a new line
printf "%s\n" "$RESULT"
exit "$ECODE"

Conda installation example

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
rm -f Miniconda3-latest-Linux-x86_64.sh
export PATH="/miniconda/bin:$PATH"
conda init
conda update -y conda
conda install python=3.10
pip install xrdsum[hdfs]

Metadata

Release files for xrdsum 2025.2.1

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

Source distribution (sdist)

Source distribution for xrdsum 2025.2.1
File Size Uploaded
xrdsum-2025.2.1.tar.gz 19.3 kB Details

Built distribution (wheel)

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

Total release size: 39.0 kB

Release files / xrdsum-2025.2.1.tar.gz

Download URL xrdsum-2025.2.1.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f95308522744e069b9bbb4d7436696895de6f27cc6f25f1adffc69c33c6fbc7e
BLAKE2b-256 checksum
How to use checksums
aa790f5de0fc2e03f33a63d17afdd29a4ff570bbf1c04c275d336a37d518c458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / xrdsum-2025.2.1-py3-none-any.whl

Download URL xrdsum-2025.2.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9c5c2f17452876077aac01e0f3814cf632d8408bbd28ff28fd2d1b3a7619384
BLAKE2b-256 checksum
How to use checksums
de8f199b7fd5ef4fe7f7394f941f1bf3fee9b4207ba1869c31c621d26567367a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

2025.2.1 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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