Skip to main content

An XNAT client that exposes the XNAT REST interface as python objects. Part of the interface is automatically generated based on the servers data model as defined by the xnat schema.

Project description

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.

Project details


Download files

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

Source Distribution

xnat-0.8.0.tar.gz (94.1 MB view details)

Uploaded Source

Built Distribution

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

xnat-0.8.0-py2.py3-none-any.whl (120.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xnat-0.8.0.tar.gz.

File metadata

  • Download URL: xnat-0.8.0.tar.gz
  • Upload date:
  • Size: 94.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.13 HTTPX/0.28.1

File hashes

Hashes for xnat-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f39a67453c731c7599f45641a37e57241241606d69bbf499eea7c5ac7f8dae70
MD5 62c7d75f8c9b46d5a6dbe9eccf39ae63
BLAKE2b-256 313abdfaf5ca7b29e03e810a5d517fc2dc0f83eea54c21beb6162f3cccee1454

See more details on using hashes here.

File details

Details for the file xnat-0.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: xnat-0.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 120.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.13 HTTPX/0.28.1

File hashes

Hashes for xnat-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a034df3a79b1afd1e61fb3f925be5cd5b0fb692052a1ab08959c2e6e737e705b
MD5 b6f8e1f94705ce9cd28faf521b044c03
BLAKE2b-256 f48697d3a2b08a49ae848e2fbd2f1d6ae5159ff448054e75f20609ac87411f59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page