Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/antoinegagne/parthenon-hs

Tool to convert Athena terms into JSON values
https://github.com/antoinegagne/parthenon-hs

athena aws cli haskell

Last synced: 15 days ago
JSON representation

Tool to convert Athena terms into JSON values

Awesome Lists containing this project

README

        

# parthenon

[![Build Status](https://github.com/AntoineGagne/parthenon-hs/actions/workflows/haskell.yml/badge.svg)](https://github.com/AntoineGagne/parthenon-hs/actions)

`parthenon` is a tool that convert Athena terms into JSON values.

## How to get

### Downloading binaries

The binaries can be found in the
[Releases](https://github.com/AntoineGagne/parthenon-hs/releases) section.

### Downloading the Docker image

The latest image can be downloaded via the following command:

```sh
docker pull haskellenthusiast/parthenon
```

Other images can be found at
[Dockerhub](https://hub.docker.com/r/haskellenthusiast/parthenon).

### Building

#### Build from source

After cloning this repository, the following command can be used to build the
binary:

```sh
stack build
```

#### Build the Docker image

```sh
docker build . -t parthenon:latest
```

## Usage

### With the binary

```sh
# Create a schema
cat << EOF > vectors
array>
EOF

cat << EOF > athena-vectors
[{x=1.0, y=1.0, z=1.0}]
EOF

echo '[{x=1.0, y=1.0, z=1.0}]' | parthenon @vectors -
# [{"x":1,"y":1,"z":1}]
echo '[{x=1.0, y=1.0, z=1.0}]' | parthenon 'array>' -
# [{"x":1,"y":1,"z":1}]
parthenon 'array>' '[{x=1.0, y=1.0, z=1.0}]'
# [{"x":1,"y":1,"z":1}]
parthenon 'array>' @athena-vectors
# [{"x":1,"y":1,"z":1}]
```

### With the Docker image

Using the Docker image is similar to the commands above:

```sh
docker run --rm -i parthenon:latest 'array>' '[{x=1.0, y=1.0, z=1.0}]'
echo '[{x=1.0, y=1.0, z=1.0}]' | docker run --rm -i parthenon:latest 'array>'
```

To make it easier to invoke the image, the following alias can be used:

```sh
alias parthenon='docker run --rm -i parthenon:latest'
```