Skip to main content

A new XNAT client that exposes XNAT objects/functions as python objects/functions. The aim is to abstract as much of the REST API away as possible and make xnatpy feel like native Python code. This reduces the need for the user to know the details of the REST API. Low level functionality can still be accessed via the connection object which has get, head, put, post, delete methods for more directly calling the REST API.

Disclaimer

This is NOT pyxnat, but a new module which uses a different philosophy for the user interface. Pyxnat is located at: https://pythonhosted.org/pyxnat/

Getting started

To install just use the setup.py normally:

python setup.py install

or install directly using pip:

pip install xnat

To get started, create a connection and start querying:

>>> import xnat
>>> session = xnat.connect('https://central.xnat.org', user="", password="")
>>> session.projects['Sample_DICOM'].subjects

when using IPython most functionality can be figured out by looking at the available attributes/methods of the returned objects.

Credentials

To store credentials this module uses the .netrc file. This file contains login information and should be accessible ONLY by the user (if not, the module with throw an error to let you know the file is unsafe).

Documentation

The official documentation can be found at xnat.readthedocs.org This documentation is a stub, but shows the classes and methods available.

Status

Currently we have basic support for almost all data on XNAT servers. Also it is possible to import data via the import service (upload a zip file). There is also some support for working with the prearchive (reading, moving, deleting and archiving).

Any function not exposed by the object-oriented API of xnatpy, but exposed in the XNAT REST API can be called via the generic get/put/post methods in the session object.

There is at the moment still a lack of proper tests in the code base and the documentation is somewhat sparse, this is a known limitation and can hopefully be addressed in the future.

Metadata

Release files for xnat 0.8.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 xnat 0.8.1
File Size Uploaded
xnat-0.8.1.tar.gz 94.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for xnat 0.8.1
File Interpreter ABI Platform
xnat-0.8.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 94.2 MB

Release files / xnat-0.8.1.tar.gz

Download URL xnat-0.8.1.tar.gz
Size 94.1 MB
Tags Source
SHA-256 checksum
How to use checksums
da153e7d4bb4e7c1becff79c9dc4097750f56f77bef4aa5b9c2c446fe54f59ad
BLAKE2b-256 checksum
How to use checksums
e49a3998a48c3a2e8792f66e3de533aad0852e6936e4446e1f343fe553c02056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.0 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.5.6 7 Apr 2026","python":"3.12.13","system":{"name":"Linux","release":"5.15.154+"}} HTTPX2/2.4.0

Release files / xnat-0.8.1-py2.py3-none-any.whl

Download URL xnat-0.8.1-py2.py3-none-any.whl
Size 120.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5944b966ca53337ee15ff99f7d7dfea99a3c6dfbef38951569ced5b52922b105
BLAKE2b-256 checksum
How to use checksums
be2fcc54888c27ceb4deae887f72be1e04b15042a95dc0e09a67dacdfa8d7566
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.0 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.5.6 7 Apr 2026","python":"3.12.13","system":{"name":"Linux","release":"5.15.154+"}} HTTPX2/2.4.0

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

3 release files

0.4.1

3 release files

0.4.0

3 release files

0.3.28

3 release files

0.3.27

3 release files

0.3.26

3 release files

0.3.25

2 release files

0.3.24

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.19

3 release files

0.3.16

2 release files

0.3.15

1 release file

0.3.13

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.9

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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