Skip to content

AntoineGagne/parthenon-hs

Repository files navigation

parthenon

Build Status

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

How to get

Downloading binaries

The binaries can be found in the Releases section.

Downloading the Docker image

The latest image can be downloaded via the following command:

docker pull haskellenthusiast/parthenon

Other images can be found at Dockerhub.

Building

Build from source

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

stack build

Build the Docker image

docker build . -t parthenon:latest

Usage

With the binary

# Create a schema
cat << EOF > vectors
array<struct<x: double, y: double, z: double>>
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<struct<x: double, y: double, z: double>>' -
# [{"x":1,"y":1,"z":1}]
parthenon 'array<struct<x: double, y: double, z: double>>' '[{x=1.0, y=1.0, z=1.0}]'
# [{"x":1,"y":1,"z":1}]
parthenon 'array<struct<x: double, y: double, z: double>>' @athena-vectors
# [{"x":1,"y":1,"z":1}]

With the Docker image

Using the Docker image is similar to the commands above:

docker run --rm -i parthenon:latest 'array<struct<x: double, y: double, z: double>>' '[{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<struct<x: double, y: double, z: double>>'

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

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