Skip to main content

The Boring XNAT Library (BXL)

PyPI version pipeline status coverage report

BXL is a library for interacting with the REST interface of XNAT (Extensible Neuroimaging Archive Toolkit), an open-source imaging informatics software platform.

Usage

Installation

BXL is available at PyPI, the Python Package Index.

With pip package management system:

 pip install bxl

Without pip:

 git clone https://gitlab.com/bbrc/xnat/bxl.git .
 cd ./bxl
 python setup.py install

Credentials handling

The xnat.Connection() class constructor expects a credentials argument to be passed when instantiated,

  • If is a tuple, it will proceed to a basic authentication procedure against the host XNAT instance.
  • If is a basestring, it will reuse it as a cookie for authentication against the host XNAT instance.
  • Otherwise (or if authentication procedure failed in the aforementioned cases), it will remain offline.

Examples

Connect to XNAT instance using an existing JSESSIONID token and get a list of user-visible XNAT projects

 import bxl.xnat as xlib

 c = xlib.Connection(hostname='http://myxnat.org',credentials='1A12346385E876546C99B4179E20986A')
 data = c.get_projects()

 projects = { item['ID'] : item['URI'] for item in data.values() }
 print(projects)

 c.close_jsession()            

Connect via 'with' statement to create a new Female subject 'dummy' in the 'test' project

 from bxl import xnat

 with xnat.Connection(hostname='http://myxnat.org',credentials=(usr,pwd)) as c :
     response = c._put_resource(URI = c.host + '/data/projects/test/subjects/dummy',
                                options = {'gender' : 'female'} )
     subject_uid = response.content
     print 'New subject %s created!' %subject_uid

Metadata

Release files for bxl 0.3.4.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for bxl 0.3.4.post1
File Interpreter ABI Platform
bxl-0.3.4.post1-py3-none-any.whl Python 3 none any Details
bxl-0.3.4.post1-py2-none-any.whl Python 2 none any Details

Total release size: 34.3 kB

Release files / bxl-0.3.4.post1-py3-none-any.whl

Download URL bxl-0.3.4.post1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
835e678acb7fe25d81f5d2f6fe97ea1c6d87da2f2891a181fd33d3221e5eaca7
BLAKE2b-256 checksum
How to use checksums
f9e0f0f8212f7497b24fbb2b92f574d618e54606a7e1ae810e8188e8bd78d47c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / bxl-0.3.4.post1-py2-none-any.whl

Download URL bxl-0.3.4.post1-py2-none-any.whl
Size 17.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
45c69277e0553dfb185e0b7eec4833a368525fd8292f44b4c59356e48fdff92c
BLAKE2b-256 checksum
How to use checksums
fecde508d4ba8701438feac712b2dc280cad6224f8a2a1c423cf8755daad5155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for bxl 0.3.4.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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