Skip to main content

About

This repository contains the Command Line Client (CLI) for Clark which was produced by Elio.earth. We aim to simpify researcher's documentation and execution processes with Clark. The CLI is a tool which researchers use to document their workflows. This enables the researcher to definitively understand the end-to-end process of their research and creates a system of record with versioning for their research (similar to Github).

Pre-requisites

  • Linux or MacOS
  • Python 3.x
  • MacOS only: sudo access to your machine (We use DTrace to trace system calls)

Install

The CLI is available from PyPI.

pip install clark-cli

Use

Below is a basic usage example from start to finish.

Register

Sign-up for an account at https://www.clarknest.com/register.

Remember to check your email to confirm your account. You will need to confirm your account before using the CLI.

Once you are registered, and you have confirmed your account you will be ready to issue commands with the CLI.

Create a Workflow

First login to the CLI using the credentials you registered with.

clark login

To view all the possible commands run:

clark --help

The next step is to create directories and workflows. Just like a filesystem, you can organize your workflows into directories. You initially start with an empty virtual filesystem.

Create a directory in the root folder (post login you always start in the root of your virtual filesystem)

clark add directory projectA

Change into the directory you just created.

clark cd projectA

Now you are ready to execute a script.

clark upload --message "A message to attach to this version of your workflow" python my_script.py

The CLI will run your script and auto-detect the inputs and outputs of the script. You will be asked to confirm the inputs and outputs before they are stored in the workflow. We upload the inputs, outputs and script to our servers.

If you made a mistake you can re-run the workflow and "replace" the previous run of the script.

clark upload --message "A different message for this run" --replace python my_script.py

Don't worry, you will have access to both versions of your workflow in the UI (described below). We create a version for each upload.

You can then go to another directory or workflow. You can back out of the workflow by:

clark cd ..

View a Workflow

You can then go to the Clark Nest to view your workflows, add notes to the nodes or workflows.

Examples

There some execution examples in the examples folder.

Contributing

If you have a bug-fix or small improvement we welcome pull requests. If unsure, please reach out to us at tech@elio.earth.

Setup Local Dev Environment

These instructions are intended for developers to set up their location development environment.

Install pyenv

Install Python 3.10.0

pyenv install 3.10.0

Download repo

cd ~/workspace/
git clone git@github.com:Elio-Earth/clark-cli.git

Create virtual env

pyenv virtualenv 3.10.0 clark-cli

Update pip

python -m pip install --upgrade pip

Install requirements

pip install -r requirements.txt

Install cli in development mode.

pip install --editable ~/workspace/clark-cli

Upgrade build

python -m pip install --upgrade build

Testing

To run the test suite

cd ~/workspace/clark-cli
pytest .

Release files for clark-cli 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clark-cli 0.4.5
File Size Uploaded
clark-cli-0.4.5.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clark-cli 0.4.5
File Interpreter ABI Platform
clark_cli-0.4.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 67.9 kB

Release files / clark-cli-0.4.5.tar.gz

Download URL clark-cli-0.4.5.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
505b29453f172d96ba4325b71647a0581322a5a87a6453c2353f1da79812574a
BLAKE2b-256 checksum
How to use checksums
e9a90d3ede0b59c1e6676eec8d5b16c9e4fece78ca388839bdd081ed1f230910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

Release files / clark_cli-0.4.5-py2.py3-none-any.whl

Download URL clark_cli-0.4.5-py2.py3-none-any.whl
Size 35.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c100319f889d3f0fd4fec50e9f09b3f5f8bc859c9220ba5f4204e20a90bf5bab
BLAKE2b-256 checksum
How to use checksums
4fefa0f131428a876cf04f4873005d6c8eaae5902789233aaf39396656d70fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page