Package: elisctl
elisctlelisctlis a set oftools for Rossum integratorsthat wrap
theRossum APIto provide an easy way to configure and customize a Rossum account - either
interactively or programmatically.InstallationSee theelisctl setup tutorialfor detailed instructions.WindowsDownload an installation file fromGitHub releases.
Install it. And run it either from start menu or from command prompt.UNIX based systemsInstall the package from PyPI:pipinstallelisctlUsagePython API Client LibraryTheelisctllibrary can be used to communicate with Rossum API,
instead of usingrequestslibrary directly. The advantages of usingelisctl:it contains a function that merges the paginated results into one list so the user does not need
to get results page by page and take care of their merging,it takes care of login and logout for the user,in case the API version changes, the change will be implemented to the
library by Rossum for all the users.See the sample script usingelisctlwithin a code to export the documents:importjsonimportloggingfromelisctl.lib.api_clientimportAPIClientfromdatetimeimportdate,timedeltaqueue_id=12673username='your_username'password='your_password'reviewed_documents="exported,exporting,failed_export"# This example downloads data for documents exported during the previous calendar day.date_today=date.today()date_end=date_todaydate_start=date_today-timedelta(days=1)defexport_documents():logging.info("Export started...")withAPIClient(context=None,user=username,password=password)asrossum:annotations_list,_=rossum.get_paginated(f"queues/{queue_id}/export",{"status":reviewed_documents,"format":"json","ordering":"exported_at","exported_at_after":date_start.isoformat(),"exported_at_before":date_end.isoformat()})withopen('data.json','w')asf:json.dump(annotations_list,f)logging.info("...export finished.")if__name__=="__main__":export_documents()API Client command line toolTheelisctltool can be either used in acommand line interfacemode
by executing each command throughelisctlindividually by passing it as an argument,
or in aninteractive shellmode of executingelisctlwithout parameters
and then typing the commands into the shown prompt.Individual Rossum operations are triggered by passing specificcommandstoelisctl.
Commands are organized by object type in a tree-like structure and thus are composed
of multiple words (e.g.user createorschema transform).So either get the list of commands and execute them immediately such as:$elisctl--help
$elisctlconfigureor run the interactive shell by simply running$elisctlSee the sample usingelisctlcommand line tool to create the main objects within an organization andassign a user to a queue:$elisctlconfigure
APIURL[https://api.elis.rossum.ai]:
Username:your_username@company.com
Password:
$elisctlworkspacecreate"My New Workspace"12345$elisctlqueuecreate"My New Queue Via Elisctl"-sschema.json-w12345--email-prefixmy-queue-email--bounce-emailbounced-docs-here@company.com50117,my-queue-email-ccddc6@elis.rossum.ai
$elisctlusercreatejohn.doe@company.com-q50117-gannotator-pmy-secret-password-15456859119,my-secret-password-154568
$elisctluser_assignmentadd-u59119-q50117Configure profilesTo run commands described below under a chosen user, it is possible to use profiles defined by
configure function such as$elisctl--profileprofile_nameconfigureAfter defining necessary profiles and their credentials, the profile can be chosen the following way$elisctl--profileprofile_namequeuelistEdit SchemaSome 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 or XLSX file.List queues to obtain schema id:$elisctlqueuelistidnameworkspaceinboxschemausers
----------------------------------------------------------------------------------------------------------------6MyQueue16myqueue-ab12ee@elis.rossum.ai727Download schema as a json:$elisctlschemaget7-Oschema.jsonOpen theschema.jsonfile in you favourite editor and upload modified version back to Rossum.$elisctlschemaupdate7--rewriteschema.jsonYou can also edit schema as an Excel (xlsx) file.$elisctlschemaget7--formatxlsx-Oschema.xlsx
$elisctlschemaupdate7--rewriteschema.xlsxFrom now on, documents will follow new schema. (Warning! If you don't use--rewriteoption,
the new schema will receive a new id - obtain it byqueue listagain.)Schema TransformationsIn addition, there is a scripting support for many common schema operations,
that may be easily used for schema management automation. Seeelisctl schema transformandelisctl toolstools for further reference.Run something like:$elisctlschematransformsubstitute-optionsdefault_schema.jsoncentre<(\elisctltoolsxls_to_csv~/Downloads/ERA_osnova_strediska.xlsx--header0--sheet1|elisctltoolscsv_to_options-)\|elisctlschematransformsubstitute-options-gl_code<(\elisctltoolsxls_to_csv~/Downloads/ERA_osnova_strediska.xlsx--header0|elisctltoolscsv_to_options-)\|elisctlschematransformremove-contract\>era_schema.jsonLicenseMITContributingUsepre-committo avoid linting issues.Submit a pull request from forked version of this repo.Select any of the maintainers as a reviewer.After an approved review, when releasing, aCollaboratorwithAdminrole shall run inmasterbranch:bump2versionminor
gitpush
gitpush--tagsTo build a Windows installer, run:pynsistinstaller.cfgChangelog2020-07-27 v2.10.1Fix attribute name for setting max token lifetime2020-07-24 v2.10.0Addschema listcommandFixwebhook changecommand issueRemovecsv getcommandAdd example script for setting up a new organisationEnable assigning manager role to userEnable setting max token lifetimeCatch ValueError when parsing schema in XLSXFix Python3.8 support2020-02-18 v2.9.0allow editing inbox attributes separately on queue-related commandsadd support forcan_collapsein xlsx schemaadd sample usage of elisctl library in a Python codemake queue option required onuser create2019-10-31 v2.8.0Add webhook commandAllow creating and changing inbox properties onqueue changecommand2019-09-30 v2.7.1Improve documentation2019-08-13 v2.7.0Add commanduser_assignmentfor bulk assignment of users to queuesChange commandconnector create:queue_idparameter needs to be specified, if there is more than one queue in organizationSupport schema attributewidthin XLSX schema formatFixed: booleans, in XLSX schema format, can be specified as boolean typesInternal: filename can be specified inELISClient.upload_document2019-07-30 v2.6.0Enable passing custom filename with upload2019-07-12 v2.5.0Add support for schema specified in XLSX when creating queueRemove the necessity to specify schema file type when uploadingFix XML and CSV formats ofelisctl document extract2019-07-09 v2.4.0Add support for can_export in xlsx schema formatAdd document command2019-06-21 v2.3.1Fix: annotator cannot useelisctl connector listcommand2019-06-13 v2.3.0Add connector command2019-06-11 v2.2.1Update packages for windows build.2019-06-03 v2.2.0Added support for--profileoption to allelisctlcommandsFix: remove extra whitespace in xlsx schema export/import2019-04-02 v2.1.0Added support for--output-filetoelisctl toolsandelisctl schema transformFixSchema Transformationsdescription in README2019-03-14 v2.0.1Fixed MS Windows application entry point (running elisctl from the start menu)Fixed parsing of boolean values in xlsx schema export/import2019-03-14 v2.0.0Disable interpolation in config parsing, so that special characters are allowed in e.g. passwordExperimental support for schema modification using xlsx file formatAllow to show help in schema transform add (backward incompatible change)2019-03-08 v1.1.1Fixed bug with UnicodeDecodeError inelisctl schema get ID -O file.jsonon Windows2019-03-03 v1.1.0Added support for python 3.6AddedUser-Agentheader (elisctl/{version} ({platform})) for every request to ELIS APIImproved error when login fails with the provided credentials