Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/datastreamapp/datastreamsh

DataSteam API helper in Shell
https://github.com/datastreamapp/datastreamsh

Last synced: 9 days ago
JSON representation

DataSteam API helper in Shell

Awesome Lists containing this project

README

        


DataStream Logo


DataStream.sh






DataStream.org API helper. See API documentation for query string values and structure.

## Install (MacOS)

```bash
curl -o /usr/local/bin/datastreamsh https://raw.githubusercontent.com/datastreamapp/datastreamsh/main/datastream.sh
chmod +x /usr/local/bin/datastreamsh
```

## Use

This package has been tested on MacOS.

```
datastreamsh command [options...]
```

### Commands

- `setup`: Prompts for API key, will be save to `~/.datastream` in plain text. Not setting up will prompt for `x-api-key` on ever command.
- `metadata`: Wraps /v1/odata/v4/Metadata API endpoint
- `locations`: Wraps /v1/odata/v4/Locations API endpoint
- `observations`: Wraps /v1/odata/v4/Observations API endpoint
- `records`: Wraps /v1/odata/v4/Records API endpoint

### Options

- `--select`: What parameters to be returned
- `--filter`: What you want to , in OData format
- `--format`: Print output in alternative format (Allowed: `JSONSTREAM`, `CSV`; Default: `JSONSTREAM`)
- `--top`: Number of results to return per request (Default: 10000)
- `--domain`: Use to point at testing environments

### Example: Setup

```bash
# datastreamsh setup
$ datastreamsh setup
x-api-key: # copy and paste API key here and press enter
```

### Example: Basic

```bash
# datastreamsh command [options...]
$ datastreamsh locations --select "..." --filter "..."
```

### Example: save as CSV to file

```bash
# datastreamsh command --format CSV --select [options...]
$ datastreamsh records --format CSV --select "..." --filter "..." > file.csv
```