Skip to main content

Access Sleep research resources from Sleepdata.org

Project description

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 below command to call python3 based pip using,

pip3 install nsrr

If python3 is not installed in the OS then you can use below command to install python,

apt-get install python3.8

Usage

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 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 during command execution instead of 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-cloud 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:

  1. It is recommended to use python version 3.8.x
  2. Compatible with Windows (tested on win10 powershell with admin privileges), Mac and Linux systems
  3. 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

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

nsrr-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

nsrr-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file nsrr-0.1.1.tar.gz.

File metadata

  • Download URL: nsrr-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for nsrr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1d89472c9a7e2f2e64099b81cc3000abf68e72f76930b1bdba7cd5d0d12225fc
MD5 2502886d8e874e11e1733e9fe5bdef18
BLAKE2b-256 8c79227c62d0dcfcb7a5bd6ac81922324a3795e6b60cb8fcf4896f126794d3da

See more details on using hashes here.

File details

Details for the file nsrr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nsrr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for nsrr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3b395bd08187ab8f4b82825f0df3ebe39d1d049e4d0d586457dbb0c7763d284
MD5 8e63d7c0f74392ef87d035234223c303
BLAKE2b-256 d605ca5444896f1ab0f0b7ce6fdf630cbed4dec19737b92a7078f6881175301d

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