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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file xnat-0.3.28.tar.gz
.
File metadata
- Download URL: xnat-0.3.28.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 365777c16278d17f42c07a8beb58fd5b1d9bac19262f0b11052845894ae6c460 |
|
MD5 | 2e83de06357cd585db19ec48410a39e7 |
|
BLAKE2b-256 | 4cbb5e358e067e2efbc98856b7302cfceaaa0ac0a0b8f1a59c4f6ff7d08a27d0 |
File details
Details for the file xnat-0.3.28-py3-none-any.whl
.
File metadata
- Download URL: xnat-0.3.28-py3-none-any.whl
- Upload date:
- Size: 75.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55f6840775322689a2013627611b6f0b281ff61bdbce6054f98904406f8eabdf |
|
MD5 | c61c4b0ecfcd4247ad60a4a2597e8f19 |
|
BLAKE2b-256 | b04c7abe749ba6d17e387cbcf8d122c6bd3cc5b1ff6febb7ff9a64659f196bd6 |
File details
Details for the file xnat-0.3.28-py2-none-any.whl
.
File metadata
- Download URL: xnat-0.3.28-py2-none-any.whl
- Upload date:
- Size: 75.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.7.1 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d66b6434dd34e469cfd6b8a15e07c7bcce16cb8f350664b4ddcd775ca10aba49 |
|
MD5 | 59644bcac0974eac3092aa4fa2acb5ac |
|
BLAKE2b-256 | c01863d9d0da9250d4050659420613eb50f457e2a250a0eaafa1ccf45c4a86ef |