This package simplifies interfacing with the Rockland Cloud, which is used for processing in situ data from microstructure gliders.
This package uses requests
for HTTP requests and xarray
with netcdf4
to write data.
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
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)
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