Skip to main content

Xnat in Python

Project description

pyxnat is a simple python library that relies on the REST API provided by the XNAT platform since its 1.4 version. XNAT is an extensible database for neuroimaging data. The main objective is to ease communications with an XNAT server to plug-in external tools or python scripts to process the data. It features:

  1. resources browsing capabilities

  2. read and write access to resources

  3. complex searches

  4. disk-caching of requested files and resources


A short overview

Setup the connection
>>> from pyxnat import Interface
>>> interface = Interface(server='http://central.xnat.org:8080',
                          user='login',
                          password='pass',
                          cachedir=os.path.join(os.path.expanduser('~'),
                                                '.store')
                          )
Browse the resources
>>> interface.select.projects().get()
[u'CENTRAL_OASIS_CS', u'CENTRAL_OASIS_LONG', ...]
Create new resources
>>> interface.select.project('my_project').create()
>>> interface.select.project('my_project').resource('images').file('image.nii').put('/tmp/image.nii')
Make complex searches
>>> table = interface.select('xnat:subjectData', ['xnat:subjectData/PROJECT', 'xnat:subjectData/SUBJECT_ID']
                    ).where([('xnat:subjectData/SUBJECT_ID','LIKE','%'),
                             ('xnat:subjectData/PROJECT', '=', 'my_project'),
                             'AND'
                             ])

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

pyxnat-0.6.2.tar.gz (300.1 kB view details)

Uploaded Source

Built Distribution

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

pyxnat-0.6.2-py2.6.egg (244.0 kB view details)

Uploaded Egg

File details

Details for the file pyxnat-0.6.2.tar.gz.

File metadata

  • Download URL: pyxnat-0.6.2.tar.gz
  • Upload date:
  • Size: 300.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyxnat-0.6.2.tar.gz
Algorithm Hash digest
SHA256 4f18be020a289b54e8c40683fbd22384d1aa57ee763bea1f92287242d9a0bcef
MD5 619a46f924df0a9d40d065f84024e9c0
BLAKE2b-256 318a26d2cc25f9d9743a3c70630c0efd8c9420c8bf808c5bad1f68c303d39514

See more details on using hashes here.

File details

Details for the file pyxnat-0.6.2-py2.6.egg.

File metadata

  • Download URL: pyxnat-0.6.2-py2.6.egg
  • Upload date:
  • Size: 244.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyxnat-0.6.2-py2.6.egg
Algorithm Hash digest
SHA256 a39a8be335ab756b9071f20399c35233b088c1a36b4c8e2bb41804f877c2381f
MD5 3c69bf05c4beb5ec5b730888dc2c1563
BLAKE2b-256 1cd45660a3f0180e0c6505d132d8161ac027200245ac6f843fdb3aa17a70333b

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