Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Arkindex API Client
===================
:ref:`genindex` - :ref:`modindex` - :ref:`search`
.. toctree::
:maxdepth: 2
:caption: Contents:
``arkindex-client`` provides an API client and a command-line tool to interact with Arkindex servers.
Command-line tool
-----------------
Once installed, a ``arkindex`` script should be in your PATH. Two commands are currently available:
``arkindex login``
Login to an Arkindex server with an email and a password, then save API tokens to a configuration file.
``arkindex upload``
Upload and import files into an Arkindex server.
Main options
^^^^^^^^^^^^
These options are available for all ``arkindex`` subcommands and should be applied before the subcommand name, like so::
arkindex --no-verify-ssl login
``--profile [name]``
Name of the configuration profile to use. Defaults to ``default``.
``--verify-ssl / --no-verify-ssl``
Enable or disable SSL certificate checks (enabled by default).
Useful when the Arkindex server uses self-signed certificates.
Login
^^^^^
To perform authenticated requests against the API, the client must obtain a user's API token.
The ``arkindex login`` commands allows to log in to an Arkindex server, fetch the API token and save it to the configuration file.
``--host [name]``
Host name of the Arkindex server. Defaults to ``arkindex.teklia.com``.
``--email``
Email to use for logging in. If this setting is omitted, a prompt will be shown asking for the email.
The script will ask for your password, then login and save tokens.
Upload
^^^^^^
The ``upload`` subcommand allows to upload files and optionally start import processes in batch::
arkindex upload --mode images Himanis ./himanis/*.jpg
This example will try to find a corpus that contains ``Himanis`` in its name, then upload all ``.jpg`` files
from the ``himanis`` folder and start an import process for each file automatically.
Options
"""""""
::
arkindex upload [--mode pdf|images] [--start/--no-start] [corpus] [files]
``corpus``
UUID or part of the name of a corpus to upload files to.
If a name is specified, corpus name matching is done in a case-insensitive manner.
If there are multiple matching corpora for a name, the matching corpora names are printed and the script exits.
``files``
Paths of all files to upload/import. Compatible shells may allow the use of wildcards (``*`` or ``**``) to specify multiple paths at once.
``--start / --no-start``
Start (or do not start) an import process for each uploaded file. Enabled by default.
This does not start a single import process for all files.
``--mode pdf / --mode images``
Set the import process mode. Defaults to ``pdf`` and is ignored if ``--no-start`` is specified.
Package reference
-----------------
API client
^^^^^^^^^^
.. autoclass:: arkindex.client.ArkindexAPI
:members:
Exceptions
^^^^^^^^^^
.. autoclass:: arkindex.client.ArkindexAPIError
:members:
Helper classes
^^^^^^^^^^^^^^
.. autoclass:: arkindex.client.ResponsePaginator
:members:
.. autoclass:: arkindex.conf.LocalConf
:members: