rossumai / elisctl Goto Github PK
View Code? Open in Web Editor NEWCommand line interface for controlling ELIS
Home Page: https://rossum.ai/
License: MIT License
Command line interface for controlling ELIS
Home Page: https://rossum.ai/
License: MIT License
Example:
pasky@gundi:~/elisctl$ elisctl csv get
Traceback (most recent call last):
File "/usr/local/bin/elisctl", line 11, in <module>
load_entry_point('elis-tools', 'console_scripts', 'elisctl')()
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/pasky/elisctl/elisctl/csv.py", line 47, in download_command
rsp = api_client.get(f"byperiod/{ceil(step.total_seconds())}/{int(start.timestamp())}")
File "/Users/pasky/elisctl/elisctl/lib/api_client.py", line 82, in get
return self._request_url("get", f"{self.url}/{path}", query)
File "/Users/pasky/elisctl/elisctl/lib/api_client.py", line 58, in url
_url = get_credential("url").rstrip("/")
File "/Users/pasky/elisctl/elisctl/configure.py", line 40, in get_credential
res = config["default"].get(attr)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 958, in __getitem__
raise KeyError(key)
KeyError: 'default'
We should guide the user to configure elisctl first.
In addition of uploading the document from a file (the case of local file system), it may be beneficial to have also a stream input (in our case of remote file system). More precisely, in this function:
def upload_document(
self, id_: int, file: str, filename_overwrite: str = "", values: Dict[str, str] = None
) -> dict:
filename = PurePath(filename_overwrite).name or PurePath(file).name
files: RequestsFiles = {"content": (filename, open(f"{file}", "rb"))}
if values is not None:
files["values"] = (None, json.dumps(values))
return get_json(self.post(f"queues/{id_}/upload", files=files))
it would be great to feed also ByteIO stream, not only file.
Hi,
I wanted to highlight that the password from ElisCtl are stored in clear in the User/.elis/credentials file. Is it planned to put some encryption for atleast the password ? I don't know if it is deliberate or not.
When a proper bool is specified in xlsx (e.g. in column "use_rir_content (bool)") schema update --format xlsx
fails with the following error:
Error: File <_io.BufferedReader name='/tmp/delme.xlsx'> could not be loaded. Because of Expecting value: line 1 column 1 (char 0)
When calling
webhook change -e annotation status --config-url http://someurl.com
the response is
Error: Invalid response [https://api.elis.rossum.ai/v1/webhooks/123]: {"events": {"0": ["\"['annotation_status']\" is not a valid choice."]}}
On webhook create
command the creation works.
click.DateTime not found
(unfortunately exact message scrolled away already, but it was in this spirit)
It appears to use the CSV connector interface rather than export queue interface, but then it uses the API endpoint URL rather than the CSV connector URL.
(But I'm actually not sure what's the purpose of this subcommand right now. :) )
Currently, access settings per queue are controlled only by user change
. This is very awkward when I create a new queue and would like to grant access to a group of users (who also have access to other queues, that should remain unaffected).
Nice & easy solution would be to allow specifying list of users to access the queue in the queue change
command.
(Another possibility would be a way to add/remove specific queue for a user instead of always specifying the full list, but that'd still be O(N) instead of O(1) for my usecase.)
It would be nice to allow to edit inbox properties (bounce e-mail, etc) through queue command.
For details see https://github.com/rossumai/elisctl/wiki/Queue-commands
Add header 'User-Agent': python-elisctl/{version}
to https://github.com/rossumai/elisctl/blob/master/elisctl/lib/api_client.py#L93
When downloading a schema that has width
attributes in it, elisctl is responding by Warning: unknown attributes: width
. The .xlsx file is downloaded correctly, though, including the width (json)
column.
It is surprising that elisctl schema transform add -h
won't print further usage instructions unless I already pass a schema file.
Using command schema get -O schema.json 6001
gives me error:
UnicodeEncodeError: 'charmap' codec can`t encode character '\u010c' in position 244: character maps to .
File is created, but empty.
System Windows 7, 64-bit, version 1.0.0., user: [email protected]
Enable user to set up max_token_lifetime_s
attribute when logging with elisctl
.
The help says
WARNING: creation of schema must be carried out with a user from within
the organization. The reason is that the schema is automatically attached
to the organization of the user, who is creating it.
But the schema just replaces the previous schema in the queues the old schema was attached to, so this is obsolete?
I attempted a first-time login to my Elis account using elisctl, and pasted my password instead of typing it (possibly including an extra space). It produced the attached error lines and @pasky suggested that this should be more elegant.
With connection to the latest changes in schema update behavior, --rewrite
option should probably be default behavior now and former behavior of creating a new schema with schema update
should be made only an option.
pasky@gundi:~/elisctl$ elisctl user create [email protected] lkj24
Error: User must be in at least 1 organization.
It would help new users to have an example script that creates organization using elisctl.
It should include: workspace, queue, inbox, schema, user
Hello,
at the moment, in order to add user to a queue one needs to state all queues the user is in. When a user has multiple queues, the command gets excessively long:
elis> user change -q 53 -q 4142 -q 4143 -q 4144 -q 4145 -q 4146 -q 4147 -q 9037 -q 14147 -q 14148 -q 16065 -q 16068 -q 16070 -q 16804 -q 16814 -q 20099 -q 21332 -q 21334 -q 21335 -q 21337 5632
create a command elisctl user queues
, which would allow for add
, remove
and list
subcommands.
Is there any way to set proxy?
This command is not widely used and makes pandas
installation required. Removing this command will allow us to remove the pandas
dependency.
It is also closely linked to the conversation in #4
At the moment the package, once built, must be manually tested.
Start with an automatic integration test that will try to install the package and will run only elisctl
command (start the interactive shell). This should prove that all python dependencies are OK.
Schema cannot be updated when using "schema update ID file.json" when updating schemas in Czech language. Error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 1626: character maps to
Windows 10 Home, 64-bit, elisctl version 1.1.1.
I installed elisctl v 1.1.0 on Windows Home 10. When I try to run it from Start menu, the app opens for a split second and then closes immediately. When running from cmd, elisctl works ok.
It would be very useful to allow several user-account configurations (username/password) in elisctl. And allow to switch between them using --profile argument (similar to aws --profile)
When elisctl configure
is run and a password with %
char is entered, the following error is raised
Password:
Traceback (most recent call last):
File "/Users/krystofpilnacekrossum/workspace/tools/venv/bin/elisctl", line 11, in <module>
load_entry_point('elis-tools', 'console_scripts', 'elisctl')()
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click_shell/core.py", line 161, in invoke
ret = super(Shell, self).invoke(ctx)
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/krystofpilnacekrossum/workspace/tools/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/krystofpilnacekrossum/workspace/tools/elisctl/configure.py", line 28, in cli
"password": click.prompt(f"Password", hide_input=True, type=str).strip(),
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 971, in __setitem__
self.read_dict({key: value})
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 753, in read_dict
self.set(section, key, value)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 1198, in set
super().set(section, option, value)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 893, in set
value)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 402, in before_set
"position %d" % (value, tmp_value.find('%')))
ValueError: invalid interpolation syntax in '"%O9#t
Also makes problems even when .elis/credentials
is set manually and some API operation is carried out.
It is currently not possible to change default_value using xlsx. The reason is that default_value may be in fact of a JSON type (null, object or array) or a string. Currently, it is always parsed as JSON.
When a connector is created without queue it disappears. Users - not even admins - cannot see connector that are not anyhow connected to their organizations.
Make the queue parameter required. Possibly, if not specified and the user has only one queue use the queue as for other subcommands.
When using schema update [id] --format xlsx (see the file attached below)
I am getting an error message Error: Invalid response [https://api.elis.rossum.ai/v1/schemas]: <h1>Server Error (500)</h1>
, although the schema is correct. The problem is in the recipient_name row. If deleted or of a new row with the same data is written instead of it, the upload is successful.
Annotator role does not have access to connector.authorization_token
, thus, the following error is produced:
Traceback (most recent call last):
File "/Users/krystofpilnacekrossum/.pyenv/versions/elisctl-venv-37/bin/elisctl", line 11, in <module>
load_entry_point('elisctl', 'console_scripts', 'elisctl')()
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click_shell/core.py", line 161, in invoke
ret = super(Shell, self).invoke(ctx)
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/krystofpilnacekrossum/.pyenv/versions/3.7.3/envs/elisctl-venv-37/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/krystofpilnacekrossum/workspace/tools/elisctl/connector.py", line 71, in list_command
for connector in connectors_list
File "/Users/krystofpilnacekrossum/workspace/tools/elisctl/connector.py", line 71, in <listcomp>
for connector in connectors_list
KeyError: 'authorization_token'
The problem can arise when boolean in text 'false
is only copied to excel. Such a value is then loaded as '\'false'
, which is not a valid JSON and a ValueError is raised. However, this error is not beautified.
Solution: https://github.com/rossumai/elisctl/blob/master/elisctl/schema/xlsx.py#L250 also ValueError
should be caught in here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.