OpenRefine command-line interface written in Bash. Supports batch processing (import, transform, export).
Go to file
Felix Lohmeier 3e6fb6a1d7
error handling for multiple file input
2022-04-20 09:45:32 +02:00
src error handling for multiple file input 2022-04-20 09:45:32 +02:00
.gitignore setup dev environment 2022-03-25 11:55:57 +01:00
.gitpod.yml create orcli symlink in $PATH 2022-04-20 09:36:03 +02:00
LICENSE Initial commit 2022-03-25 10:34:28 +01:00
README.md update examples 2022-04-14 00:04:35 +02:00
orcli first draft export tsv 2022-04-14 10:06:54 +00:00

README.md

orcli (💎+🤖)

Bash script to control OpenRefine via its HTTP API.

Features

  • works with latest OpenRefine version (currently 3.5)
  • nested sub-commands with help screens and usage examples
  • batch processing (import, transform, export) with temporary workspaces; your existing OpenRefine data will not be touched
  • import CSV, TSV, line-based TXT, fixed-width TXT, JSON or XML (and specify input options)
  • transform data by providing an undo/redo JSON file; orcli calls specific endpoints for each operation to provide improved error handling and logging
  • export to TSV, CSV, HTML, XLS, XLSX, ODS
  • templating export to additional formats like JSON or XML

Requirements

Install

  1. Navigate to the OpenRefine program directory

  2. Download bash script there and make it executable

wget https://github.com/opencultureconsulting/orcli/raw/main/orcli
chmod +x orcli
  1. Create a symlink in your $PATH (e.g. to ~/.local/bin)
ln -s "${PWD}/orcli" ~/.local/bin/

Usage

Ensure you have OpenRefine running (i.e. available at http://localhost:3333 or another URL) or use the integrated start command first.

Use integrated help screens for available options and examples for each command.

$ orcli --help
orcli - OpenRefine command-line interface written in Bash

Usage:
  orcli [command]
  orcli [command] --help | -h
  orcli --version | -v

Commands:
  info     show project metadata
  import   import commands
  list     list projects on OpenRefine server

Options:
  --help, -h
    Show this help

  --version, -v
    Show version number

Environment Variables:
  OPENREFINE_URL
    URL to OpenRefine server
    Default: http://localhost:3333

Examples:
  orcli list
  orcli import csv file
  orcli import csv
  "https://github.com/LibraryCarpentry/lc-open-refine/raw/gh-pages/data/doaj-article-sample.csv"
  orcli info Clipboard
  orcli info 1234567890123

https://github.com/opencultureconsulting/orcli

Development

orcli uses bashly for generating the one-file script from files in the src directory

  1. Install bashly (requires ruby)
gem install bashly
  1. Edit code in src directory

  2. Validate and generate script

bashly validate
bashly generate