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.3.16.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

xnat-0.3.16-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xnat-0.3.16.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2rc1

File hashes

Hashes for xnat-0.3.16.tar.gz
Algorithm Hash digest
SHA256 0c70f8dc92e348fa51d8f8254df3808af932ba3a0ebe0eaa6297a0d5aa171661
MD5 a396e49435c144ddff9bf2660ed6bf36
BLAKE2b-256 b6d085adea0f188bdd601a143ea28e2c4bd3dffd27470ecd65c8d8131f78bb60

See more details on using hashes here.

File details

Details for the file xnat-0.3.16-py3-none-any.whl.

File metadata

  • Download URL: xnat-0.3.16-py3-none-any.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2rc1

File hashes

Hashes for xnat-0.3.16-py3-none-any.whl
Algorithm Hash digest
SHA256 523889fc6daa9d1bbfb54bce4c55f18ace5d56077842ea24c96ef3688af73abe
MD5 88c685b0308389606401a5e2409bcae6
BLAKE2b-256 5801b3f7981466dd3b744ab2f93a707e63cbc20f9f14a2231ee65e785520fcd9

See more details on using hashes here.

Supported by

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