nsrr
nsrr - a Python-based client library is available for users to access NSSR Cloud resources. This library is compatible with Mac, Linux and Windows (tested on win10 PowerShell with admin privileges).
Installation
pip install nsrr
If both version of Python i.e., Python2.x and Python3.x are installed in the OS then you can use the command below to call Python3 based pip using:
pip3 install nsrr or python3 -m pip install nsrr
Usage
This section of the documentation covers usage of 'CFS' dataset as an example.
To learn about different parameters, use help argument:
nsrr --help
To list approved datasets access of a user:
nsrr --list-access
To list all the files of the dataset:
nsrr cfs --list-files
To list all the directories of the dataset:
nsrr cfs --list-directories
To download based on a folder or file path:
nsrr -d cfs/forms
nsrr -d cfs/dataset/cfs-data-dictionary-0.5.0-variables.csv
nsrr -d cfs/polysomnography/annotations-events-nsrr
To download entire dataset:
nsrr -d cfs
To decompress EDFZ files into EDF files, and delete the compressed originals:
nsrr -d cfs --decompress
To learn more about EDFZ file format, visit EDFZ: working with compressed EDFs{:target="_blank"}.
To list all the subjects of a specific dataset:
nsrr cfs --list-subjects
To download subject specific files from a dataset:
nsrr -d cfs --subject 800002
To provide password in non-interactive way:
nsrr -d cfs --token-file token.txt
Data Integrity check is performed via the following two options.
- (Recommended) md5 checksum value is unique to every file. This option verifies that the downloaded file is same as being served by NSRR using md5 checksum value comparison.
- file size check to match with download size of the file hosted by NSRR.
To skip memory intensive data-integrity check:
nsrr cfs -d --no-md5
To forcefully download the whole dataset:
nsrr -d cfs --force
To list the version of the nsrr library:
nsrr -v
Developer guide
Prerequisites
Following installation are necessary to start development,
- Python (version >=3.6)
- Auth server is running
Initialization
Update Auth server address in the 'nsrr.py' file
Build and publish package
Delete any existing distributions in the dist folder:
rm -rf dist/*
Update setup.py, nsrr/main.py and nsrr/init.py to bump version number:
ex: vi nsrr/__init__.py
__version__ = "x.x.x"
Run build command:
python3 setup.py sdist bdist_wheel
Update test pypi with the latest version:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Upload pypi with the latest version:
twine upload -u <username> -p <password> dist/*
Notes:
- It is recommended to use Python version 3.8.x
- Compatible with Windows (tested on win10 powershell with admin privileges), Mac and Linux systems
- Data Integrity check is performed via the following two options
- (Recommended) md5 checksum value is unique to every file. This option verifies that the downloaded file is exactly the same as being served by NSRR using md5 checksum value comparison. Use '--no-md5' to skip this option
- file size check to match with download size of the file hosted by NSRR
Metadata
Release files for nsrr 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nsrr-0.2.0.tar.gz | 8.8 kB | Without provenance | Details for nsrr-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nsrr-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nsrr-0.2.0-py3-none-any.whl |
Total release size: 16.7 kB
Release files / nsrr-0.2.0.tar.gz
| Download URL | nsrr-0.2.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38e508314d6ae31a59ee3554dbc629fbfa5139223baab0ee171d0427a57c68ab
|
|
BLAKE2b-256 checksum How to use checksums |
82ca4a8572cf97c6144ec6947f286480a44bed0573114c9c51ea31405f19d471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Release files / nsrr-0.2.0-py3-none-any.whl
| Download URL | nsrr-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5bbefc3ce8e97ed40715146ee2d812bcba12e6882bf649c44b79bd601a89721
|
|
BLAKE2b-256 checksum How to use checksums |
ead99b691e82bacc4f6cbcf9f522e6eb4c86bd5f81f1b714456f48ed63a19f57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Security for nsrr 0.2.0
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.