skillfed

pyxnat

XNAT in Python

pyxnat v1.6.4 401.7K downloads/30d#6,925 on PyPI79
Permissive license BSD Active released

What it is and what it does

pyxnat is a Python library that wraps the XNAT REST API, allowing researchers and developers to programmatically interact with XNAT servers—systems commonly used in neuroimaging and biomedical research to store, manage, and retrieve medical imaging data. It depends on requests for HTTP communication and lxml for XML parsing, which are core to XNAT's data exchange format. The package is classified as Beta and targets Python 3.9 and 3.10, with active maintenance and no known security vulnerabilities.

Typically used in research workflows where imaging data needs to be queried, downloaded, or uploaded in bulk, or where imaging projects must be managed programmatically. It abstracts away the complexity of direct REST calls, offering a more Pythonic interface to XNAT's object hierarchy (projects, subjects, experiments, scans, resources).

Use it for:

  • Batch download imaging datasets from an XNAT repository for local analysis pipelines.
  • Programmatically upload processed imaging results back to an XNAT server for archival and sharing.
  • Query and filter imaging projects by metadata to identify cohorts for research studies.
  • Automate routine data management tasks on XNAT servers without manual web interface interaction.
  • Integrate XNAT data access into reproducible research workflows and computational notebooks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyxnat provides Python bindings to interact with XNAT (Extensible Neuroimaging Archive Toolkit) servers, enabling programmatic access to medical imaging data and project management through HTTP requests.

Yes, if you work with XNAT servers in a research or clinical setting. The package is actively maintained, has no security vulnerabilities, and low install friction. It is the standard Python interface to XNAT and solves a real problem for anyone needing programmatic access to imaging archives. Not relevant if you do not use XNAT.

Install

pyxnat on PyPI

pip

pip install pyxnat

uv

uv add pyxnat

poetry

poetry add pyxnat

Installing pyxnat

Before you install

Low friction installation with three stable runtime dependencies (lxml, requests, pathlib). Package is actively maintained with a recent release and no known vulnerabilities.

License in practice

BSD license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.

Quickstart

pip install pyxnat

import pyxnat
xnat = pyxnat.Interface(server='http://xnat-server', user='username', password='password')
project = xnat.select.project('PROJECT_ID')

Requires an accessible XNAT server instance to connect to; authentication credentials needed.

Verify before relying

  • Whether pathlib is truly a runtime dependency or a standard library reference in the metadata.
  • Specific XNAT server version compatibility requirements beyond the general API.
  • Performance characteristics when working with large imaging datasets.

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — lxml, requests, pathlib
Maintenance actively maintained — 281 days since the last release
Last repo commit
First released
Downloads 401,709/month — #6,925 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyxnat-1.6.4-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Scientific/EngineeringTopic :: Utilities

Tags

XNAT Python clientneuroimaging data accessmedical imaging repository APIXNAT REST interfacebiomedical data management Pythonimaging archive integrationXNAT server interaction
medical-imagingrest-api-clientresearch-data

More Scientific/Engineering packages