Skip to main content

dcache-pyclient

A Python client for user interaction with a dCache instance to manage data through the REST API and WebDAV door. This tool is a Python implementation of the ADA (Advanced dCache API) bash script.

Disclaimer: Currently under development, usage only advised for (beta) testing.

Documentation

If you want to use a released version of dcache-pyclient, find the instructions in the documentation.

Development

If you want to install an unreleased version, develop, or test locally, you can download the dcache-pyclient source code by cloning this repository:

git clone https://github.com/sara-nl/dcache-pyclient.git
cd dcache-pyclient

We recommend working in a virtual environment. You can create one with:

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip

Install with Poetry

If you plan to publish the package, we recommend using Poetry to install, build, and distribute the package. Poetry is a tool for dependency managing and packaging in Python. If you don't have Poetry, install it first with pipx install poetry.

poetry install --with test

Note that Poetry will create a virtual environment if it is not running within an activated virtual environment already. In that case, you will need to run poetry run before your commands to execute them within the Poetry virtual environment.

Install with Pip

If you prefer not to use Poetry, then you can install dcache-pyclient with:

pip install -U -e .
pip install pytest

Test installation

To perform the unit tests, run:

pytest tests/unit

To perform the integration tests, that actually interact with a dCache instance, you need to create a json file with the following information (see tests/env.json for a template):

{
    "user": "user_name",
    "api": "api_url",
    "webdav": "webdav_url",
    "homedir": "user_homedir_on_dcache",    
    "testdir": "test_dirname",
    "tokenfile": "tokenfile.conf"
}

where user_homedir_on_dcache is the full path of the user's home directory on dCache; testdir is the directory in which test data will be written (without user_homedir_on_dcache in front); tokenfile.conf is an rclone config file that can be created with get-macaroon.

Then run:

pytest tests/integration --target-env tests/env.json -v

This will run integration tests for both the ADA CLI and library. You can also run them separately with:

pytest tests/integration/test_cli.py --target-env tests/env.json -v
pytest tests/integration/test_library.py --target-env tests/env.json -v

Build documentation

The documentation is generated automatically with Sphinx and Github Actions, see the workflow. If you want to build the documentation locally, run:

pip install sphinx sphinx_rtd_theme myst_parser
sphinx-apidoc -o docs/source src/ada
sphinx-build -M html docs/source docs/build   

This will create html files in docs/build/html.

Download files

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

Source Distribution

dcache_pyclient-0.2.0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

dcache_pyclient-0.2.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file dcache_pyclient-0.2.0.tar.gz.

File metadata

  • Download URL: dcache_pyclient-0.2.0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.7 Darwin/25.5.0

File hashes

Hashes for dcache_pyclient-0.2.0.tar.gz
Algorithm Hash digest
SHA256 da08ec3073a51bd9541603cd3b01ab22c0bc255d79f62e68b36bb19e2c53ee03
MD5 a8b37d69ddca25b889672030f9c4df9e
BLAKE2b-256 e645ab33be7cc9ace04dec4d2d5c4f7aca64e1f08ed203164f5b26e964d47fd3

See more details on using hashes here.

File details

Details for the file dcache_pyclient-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dcache_pyclient-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.7 Darwin/25.5.0

File hashes

Hashes for dcache_pyclient-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f84c1f08861cc0875b6a317abd9a259a6394b580187b9ec6aab7cce055e4489
MD5 fd4997b932d8e681bb557ac35008dfb0
BLAKE2b-256 a3062e2957acd35a3cbc2fb0efa9f43614f537a15ae7d0748ee95a7877c2dd97

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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