Skip to main content

Command line interface for controlling ELIS

Project description

elisctl

PyPI - version Build Status Code style: black codecov PyPI - supported python versions MIT licence

elisctl is a set of tools that wrap the Elis Document Management API to provide an easy way to configure, integrate and customize Elis - either interactively or programmaticaly.

Installation

Windows

Download an installation file from GitHub releases. Install it. And run it either from start menu or from command prompt.

UNIX based systems

Install the package from PyPI:

pip install elisctl

How to use

Individual Elis operation are triggered by passing specific commands to elisctl. Commands are organized by object type in a tree-like structure and thus are composed of multiple words (e.g. user create or schema transform).

The elisctl tool can be either used in a command line interface mode by executing each command through elisctl individually by passing it as an argument, or in an interactive shell mode of executing elisctl without parameters and then typing the commands into the shown prompt.

So either get the list of commands and execute them immediately such as:

elisctl --help
elisctl configure

or run the interactive shell by simply running

elisctl

Edit Schema

Some of the most common advanced operations are related to setting up the sidebar-describing schema according to business requirements. Using elisctl you can edit schema easily as a JSON file.

List queues to obtain schema id:

elisctl queue list
  id  name                           workspace  inbox                                       schema  users
----  ---------------------------  -----------  ----------------------------------------  --------  ----------------------
   6  My Queue 1                             6  myqueue-ab12ee@elis.rossum.ai                    7  27

Download schema as a json:

elisctl schema get 7 -O schema.json

Open schema.json file in you favourite editor and upload modified version back to Elis.

elisctl schema update 7 schema.json

From now on, documents will follow new schema.

As an experimental feature, you can also edit schema as an Excel (xlsx) file.

elisctl schema get 7 --format xlsx -O schema.xlsx
elisctl schema update 7 --format xlsx schema.xlsx

Schema Transformations

In addition, there is a scripting support for many common schema operations, that may be easily used for schema management automation. See elisctl schema transform and elisctl tools tools for further reference.

Run something like:

elisctl schema transform default_schema.json substitute-options centre <( \
   elisctl tools xls_to_csv ~/Downloads/ERA_osnova_strediska.xlsx --header 0 --sheet 1 | elisctl tools csv_to_options - ) \
 | elisctl schema transform - substitute-options gl_code <( \
    elisctl tools xls_to_csv ~/Downloads/ERA_osnova_strediska.xlsx --header 0 | elisctl tools csv_to_options - ) \
 | elisctl schema transform - remove contract \
 > era_schema.json

License

MIT

Contributing

  • Submit a pull request from forked version of this repo. And select any of the maintainers as a reviewer.
  • Use pre-commit to avoid linting issues.
  • When releasing, run in master branch:
    bumpversion minor
    git push
    git push --tags
    

Changelog

2019-03-14 v2.0.1

  • Fixed MS Windows application entry point (running elisctl from the start menu)
  • Fixed parsing of boolean values in xlsx schema export/import

2019-03-14 v2.0.0

  • Disable interpolation in config parsing, so that special characters are allowed in e.g. password
  • Experimental support for schema modification using xlsx file format
  • Allow to show help in schema tranform add (backward incompatible change)

2019-03-08 v1.1.1

  • Fixed bug with UnicodeDecodeError in elisctl schema get ID -O file.json on Windows

2019-03-03 v1.1.0

  • Added support for python 3.6
  • Added User-Agent header (elisctl/{version} ({platform})) for every request to ELIS API
  • Improved error when login fails with the provided credentials

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elisctl-2.1.0.tar.gz (22.0 kB view details)

Uploaded Source

File details

Details for the file elisctl-2.1.0.tar.gz.

File metadata

  • Download URL: elisctl-2.1.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for elisctl-2.1.0.tar.gz
Algorithm Hash digest
SHA256 eac31c0d81c3f5ceac1a4a0fff328161391b0c131af71f5172aad187689d4e4b
MD5 749a8a5532a2ab45746322989f8ebd65
BLAKE2b-256 18d2bef6d2217a69cc73b2be47880fb5004afdd974b249e83e8cc1c565a6f593

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page