New command to build a CSV files with details about elements
Needed for ABBYY import.
Please log your time on https://redmine.teklia.com/issues/1270
We need a new sub-command arkindex elements list
that will use
The command must simply use one of these endpoints, runs through the whole pagination and output results in a CSV file with the following columns:
- id
- name
- type
- image_id (if a zone is set)
- image_url (if a zone is set)
- polygon (if a zone is set)
- worker_version_id
- created
The command CLI options are:
-
--corpus
(optional corpus id, triggers the usage ofListElements
) -
--parent
(optional UUID of an element, triggers the usage ofListElementChildren
-
--type
(optional) -
--recursive
(optional boolean, default to false) -
--output
(optional path towards the csv, defaults toelements.csv
)
--corpus
& --parent
are mutually exclusive
The goal for BIS-OCR is to generate a list of pages in a given folder. So the command will be:
arkindex elements list --parent=036bdfc2-bd40-4268-886b-f227b4ece49f --type=page --output=bis-ocr-pages.csv
which should list the same thing as https://demo.arkindex.org/element/036bdfc2-bd40-4268-886b-f227b4ece49f?type=page&order=position&order_direction=asc
Edited by Bastien Abadie