The ARI Transcoder Tool

This tool converts ARIs between different encoding forms.

It uses environment variables to control where ADMs are searched for and command options to control the ARI conversion. For text or cborhex forms of input or output, each line is handled as a separate ARI and converted independently until the input stream is ended. For cbor form of input or output, the stream is treated as a CBOR sequence and each item is handled as a separate ARI.

usage: ace_ari [-h] [--log-level {debug,info,warning,error}]
               [--inform {text,cbor,cborhex}] [--input INPUT]
               [--outform {text,cbor,cborhex}] [--output OUTPUT]
               [--must-nickname]

Named Arguments

--log-level

Possible choices: debug, info, warning, error

The minimum log severity.

Default: 'info'

--inform

Possible choices: text, cbor, cborhex

The input encoding.

Default: 'text'

--input

The input file or “-” for stdin stream.

Default: '-'

--outform

Possible choices: text, cbor, cborhex

The desired output encoding.

Default: 'cbor'

--output

The output file or “-” for stdout stream.

Default: '-'

--must-nickname

Require that a nickname exist when converting from text.

Default: False

Environment Variables

The following environment variables control how the tool searches for and loads ADM files.

ADM_PATH

This is the highest priority search path. All files in the directory named by this variable following the pattern *.json are loaded as ADMs.

XDG_DATA_HOME, XDG_DATA_DIRS

These directories are used in accordance with the XDG Base Directory Specification with the suffix path /ace/adms. All files in the search subdirectories following the pattern *.json are loaded as ADMs.

XDG_CACHE_HOME

This directory is used in accordance with the XDG Base Directory Specification with the suffix path /ace for storing cached data. The two cache names used are adms.sqlite file and ply directory.

Examples

The XDG-default local search paths for ADM files would be the priority ordering of

  1. $ADM_PATH

  2. $HOME/.local/share/ace/adms

  3. /usr/local/share/ace/adms

  4. /usr/share/ace/adms

And the XDG-default cache directory for ADM lookup and ARI parsing is $HOME/.cache/ace.