Skip to main content

neurodesk

neurodesk is a Python client and shell helper for the ccx3 daemon. It is focused on Neurodesk container discovery, CVMFS-backed image import, VM lifecycle management, and running container commands from Python, notebooks, or normal shell scripts.

What It Provides

  • A typed HTTP client for ccvm
  • High-level container("name") helpers for Neurodesk containers
  • CVMFS listing and file-read helpers
  • Automatic daemon startup for local workflows
  • Shell activation and command wrappers for nd load / nd exec
  • Fulltest helpers for running Neurodesk test suites inside containers

Installation

The package is published as neurodesk:

pip install neurodesk

Both import neurodesk and import pyneurodesk are supported.

Development Setup

The package uses uv and requires Python 3.9 or newer.

cd pyneurodesk
uv sync
uv run pytest

The default package install keeps the client and shell dependencies small. The pyneurodesk-fulltest helper needs NIfTI and YAML support, so install the optional extra when you want to run fulltest recipes:

uv sync --extra fulltest

Publishing

Platform wheels should include the bundled ccvm binary so installs do not need a Go toolchain at runtime. Use the repository release helper from the repo root to cross-compile the currently supported wheels (linux/amd64, linux/arm64, darwin/arm64, and stable windows/amd64) with CGO_ENABLED=0:

UV_PUBLISH_TOKEN=pypi-... tools/publish_neurodesk.sh

By default the helper builds and publishes wheels only. To also publish a source-only sdist, run:

UV_PUBLISH_TOKEN=pypi-... tools/publish_neurodesk.sh --include-sdist

The sdist intentionally does not contain ccvm; installing from it fails during wheel build unless ccvm is discoverable through PYNEURODESK_CCVM, CCX3_CCVM, CCVM_BINARY, or PATH.

If you want to exercise real VM execution, build the Go daemon first from the repository root:

go build -o /tmp/ccx3-dev/ccvm ./cmd/ccvm

Then point pyneurodesk at it if it is not bundled in the default location:

export PYNEURODESK_CCVM=/tmp/ccx3-dev/ccvm

Python Usage

Run a Neurodesk command from Python:

import neurodesk as nd

niimath = nd.container("niimath")
print(niimath.run("niimath", "-help"))

Share a host directory with a container:

from pathlib import Path
import neurodesk as nd

work = nd.share_dir(Path.cwd(), writable=True)
niimath = nd.container("niimath")
print(niimath.run("sh", "-lc", f"ls {work.guest_path}"))

Connect to an existing daemon:

import neurodesk as nd

client = nd.connect(base_url="http://127.0.0.1:3456")
print(client.instance_status())

Shell Usage

Generate an activation script and load a container:

source <(uv run neurodesk activate --shell bash)
nd load niimath
niimath -help

On PowerShell, neurodesk activate auto-detects the native shell. The short form uses PowerShell's built-in iex alias:

nd activate | iex
nd load niimath
niimath -help

Run a one-off command through the active VM:

nd exec niimath -- niimath -help

Bind a shell session to a named cc VM when you want separate parallel sessions:

source <(uv run neurodesk activate --shell bash --vm analysis)
nd load niimath
nd exec niimath -- niimath -help

You can also target one command explicitly:

nd load niimath --vm analysis
nd exec --vm analysis niimath -- niimath -help

The shell integration creates wrapper scripts in a session directory under the user cache directory and reuses the shared daemon/VM where possible.

CVMFS Helpers

Search for available versions:

import neurodesk as nd

print(nd.search("niimath"))

Import a specific CVMFS path with the lower-level client:

import neurodesk as nd
from pyneurodesk.models import CVMFSSource, ImportImageRequest

client = nd.connect()
source = CVMFSSource(
    mirror="http://cvmfs.neurodesk.org",
    repo="neurodesk.ardc.edu.au",
    path="/containers/niimath_1.0.20250804_20251016",
)
client.import_image("niimath-cvmfs", ImportImageRequest.from_cvmfs_container(
    mirror=source.mirror,
    repo=source.repo,
    path=source.path,
))

Tests

Unit tests do not require KVM or a live daemon:

uv run pytest

The shell smoke example does require the Go daemon and host virtualization:

./examples/test_niimath_shell.sh

Environment Variables

  • PYNEURODESK_BASE_URL: connect to an existing ccvm daemon
  • PYNEURODESK_CCVM: path to the ccvm binary used for automatic startup
  • PYNEURODESK_CACHE_DIR: cache root for daemon state and shell sessions
  • PYNEURODESK_HTTP_TIMEOUT: default HTTP timeout in seconds
  • PYNEURODESK_BOOT_TIMEOUT: VM boot timeout in seconds, default 5
  • CCX3_VM_BOOT_TIMEOUT: daemon-side VM boot timeout in seconds, default 5
  • PYNEURODESK_RELEASES_DIR: local Neurodesk release metadata directory
  • PYNEURODESK_RELEASES_API: GitHub contents API endpoint for release metadata

Notes

pyneurodesk delegates actual container execution to ccvm. On stable amd64 hosts (linux/amd64 and windows/amd64), the daemon currently runs native amd64 containers and rejects known foreign architectures. Live execution requires the host virtualization setup described in the top-level repository README.

Metadata

Release files for neurodesk 0.4.0

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

Built distributions (wheels)

Table of built distributions (wheels) for neurodesk 0.4.0
File
neurodesk-0.4.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
neurodesk-0.4.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
neurodesk-0.4.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
neurodesk-0.4.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 43.8 MB

Release files / neurodesk-0.4.0-py3-none-win_amd64.whl

Download URL neurodesk-0.4.0-py3-none-win_amd64.whl
Size 11.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d3929dc51a6044c27e90840679dc7ff8622ff0ba08a01731b5fbebbb9d210e40
BLAKE2b-256 checksum
How to use checksums
398834ecef817a42cbd1a0a10095220011c7d1eea51d8c32b2676ff072abcc9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / neurodesk-0.4.0-py3-none-manylinux_2_17_x86_64.whl

Download URL neurodesk-0.4.0-py3-none-manylinux_2_17_x86_64.whl
Size 11.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
785446ebff8242e7bad8efc585f6cb52e25eee226e7828cf885f4e482fb4bf73
BLAKE2b-256 checksum
How to use checksums
e493782dc2379fd58e8031fbce93cb6b3a03f6134bee38246afca38971a59f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / neurodesk-0.4.0-py3-none-manylinux_2_17_aarch64.whl

Download URL neurodesk-0.4.0-py3-none-manylinux_2_17_aarch64.whl
Size 10.5 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
62523bbdf50785b6e9a116641817f047edd8b9975a8930d923461ba4ba61b9fd
BLAKE2b-256 checksum
How to use checksums
37064986b4af41c9ec22d1717b5dc86933d33aa1e33476b1b407e9dffbf16827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / neurodesk-0.4.0-py3-none-macosx_11_0_arm64.whl

Download URL neurodesk-0.4.0-py3-none-macosx_11_0_arm64.whl
Size 10.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b12e381ebcc2056ac42afba571dc759ba94389a7ebac8694078ad281ec1e5a48
BLAKE2b-256 checksum
How to use checksums
9457c9ae274f8391ca020145624efcea5849800e72262674b7dda3fa488e6608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for neurodesk 0.4.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.

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.

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

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