Giter VIP home page Giter VIP logo

rocklandapi's Introduction

rapi - The Rockland Scientific API command line interface and wrapper

This package simplifies interfacing with the Rockland Cloud, which is used for processing in situ data from microstructure gliders.

Requirements

This package uses requests for HTTP requests and xarray with netcdf4 to write data.

Installation

Install with pip:

pip install git+https://github.com/mousebrains/RocklandAPI.git

After installation you will have acess to the command line interface (CLI), e.g.

rapi project list
rapi download --directory="save_to" PROJ

By default, configuration files are stored in ~/.config/Rockland

If the file credentials.yaml does not exist in the configuration directory, you will be prompted for a username, password, and organization.

To create a project use:

rapi project create probar "Probar un proyecto" 123

To list existing projects use:

rapi project list

This project is still in development. To enable debugging, use the --debug option, e.g.

rapi --debug project delete probar

Scripting

rapi may also be used in a scipt, e.g.

from pathlib import Path
from rapi import RAPI

project = "probar"
data_dir = Path("Dockserver/glider/from-glider")
save_dir = Path("out")

parser = RAPI.mkParser()

# Upload one by one
mri_files = data_dir.glob("*.mri")
for file in mri_files:
    print(f"Uploading {file.name}")
    # Recreate command line argument
    args = parser.parse_args(["upload", project, str(file)])
    RAPI.run(args)

conda environment

The API requires some non-standard python packages, such as requests. These can be installed into a conda environment using: conda env create -f environment.yml

rocklandapi's People

Contributors

jessecusack avatar mousebrains avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jessecusack

rocklandapi's Issues

Error creating project

With

./Rockland.py --debug project create jc_test "JC test project" 4321

Not sure why the request is bad and contains a NaN

2022-10-24 10:46:06,559 INFO: url https://rocklandapi.azurewebsites.net/api/Project/Create
2022-10-24 10:46:06,559 ERROR: Fetching https://rocklandapi.azurewebsites.net/api/Project/Create
2022-10-24 10:46:06,559 ERROR: Code 400 -> Reason Bad Request
2022-10-24 10:46:06,559 ERROR:
{
    "errors": {
        "": [
            "Error parsing NaN value. Path '', line 1, position 2."
        ]
    },
    "status": 400,
    "title": "One or more validation errors occurred.",
    "traceId": "00-b3a42e26f506ca49a30b105aaa96c6d9-84d323f808f21640-00",
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1"
}
2022-10-24 10:46:06,561 INFO: cmd create mapping <__main__.ProjectCreate object at 0x103cb4160>

How to collaborate?

@mousebrains, how do you want to work on this. Would you prefer I make pull-requests from my fork or that I commit directly to this repo or something else?

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.