Coder Social home page Coder Social logo

pynsgr's Introduction

pynsgr

GitHub CI PyPI PyPI - Python Version GitHub GitHub pull requests GitHub issues

Python interface to the NeuroScience Gateway REST interface, based on the previously developed pycipres.

Quick start guide

Creating an account on NSGR

Please head to the NSGR web portal to create an account. Documentation there includes the list of available tools and other information. A tutorial is available, and so is a complete user guide.

Once you have created an account, you must create a new "application" to be able to use the REST API:

  • login, click "Developer" > "Application management"
  • click "create new application"
  • fill in the form: please use the "DIRECT" authentication type

This will create the application for you and create an application ID for you to use (see below).

Using this package

  1. Install this package directly using pip:
pip install pynsgr

or from source (to get the latest development version, for example):

git clone https://github.com/OpenSourceBrain/pynsgr
cd pynsgr
pip install .
  1. Update ~/nsgrest.conf with your account and application information:
URL=https://nsgr.sdsc.edu:8443/cipresrest/v1
USERNAME=<YOUR_USERNAME>
PASSWORD=<YOUR_PASSWORD>
APPID=<YOUR_APPID>
APPNAME=PY_EXPANSE
  1. Try listing your jobs
nsgr_job -l
  1. Submit a job
nsgr_submit <directory> validate
nsgr_submit <directory> run

For more information on what the tools do, use the -h option:

nsgr_submit -h
nsgr_job -h

where <directory> contains the zipped code to run, and the two properties files. See the example folder for an example of this and configuration files that are used.

pynsgr's People

Contributors

pgleeson avatar sanjayankur31 avatar musicinmybrain avatar

Stargazers

Lefteris Rodinos avatar  avatar

Watchers

Matteo Cantarelli avatar  avatar Eugenio Piasini avatar  avatar  avatar

pynsgr's Issues

Handle exception when config file not found

At the moment, it crashes with an Exception. It shouldn't crash


Traceback (most recent call last):
  File "/usr/bin/nsgr_job", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/pynsgr/commands/nsgr_job.py", line 162, in main
    sys.exit(nsgr_job(sys.argv))
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pynsgr/commands/nsgr_job.py", line 86, in nsgr_job
    properties = CipresClient.Application(conf_filepath).getProperties()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pynsgr/client.py", line 499, in __init__
    raise Exception(
Exception: Didn't find the file: ~/.nsgrest.conf or ~/nsgrest.conf (which should contain properties {'USERNAME', 'URL', 'APPID', 'APPNAME', 'PASSWORD'}) or /opt/user/nsgrest.conf on Open Source Brain v2.

Add option to allow specifying location of config file

~/nsgrest.conf is not a very good location, especially given that the info is stored in plaintext. Users may also have multiple application ids, and so multiple config fies. It'll be good to allow users to specify the location of the config file.

Improve help output

The help output can be improved, also to improve the generation of man pages. The command line options should also be consistent---as in both should provide the same option for help and so on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.