alephclient
is a command-line client for Aleph. It can be used to bulk import document sets via the API, without direct access to the server.alephclient
, you need to have Python 3 installed and working on your computer. You may also want to create a virtual environment using virtualenv
or pyenv
. With that done, type:alephclient
needs to know the url of an Aleph instance that it will connect to. For privileged operations, it will also need to know the user's API key. The API key can be found in the users profile page on the Aleph web application.ALEPHCLIENT_HOST
and ALEPHCLIENT_API_KEY
respectively; or by passing them in with --host
and --api-key
options directly for the command. The examples below will assume you have set up the environment variables:.bashrc
, .zshrc
)crawldir
command crawls through a given directory recursively and uploads all the files and directories inside it to a collection. The external identifier (foreign ID) of the target collection needs to be passed to the command with --foreign-id
option. If a collection with the given foreign ID does not exist, it will be created. The path
argument needs to be a valid path to a file or directory:--language
option, which expects a 3-letter ISO 639 language code. It can be specified multiple times, for when the directory contains files in more than one language.write-entities
command, users can load JSON-formatted entities formatted in the followthemoney
structure into an aleph collection. This can be used in conjunction with the command-line tools for generating such data provided by followthemoney
. Data that is loaded this way should be aggregated before being written to the API, for example using the ftm aggregate
command-line utility, or the followthemoney-store
database layer.stream-entities
is the inverse of write-entities
. It will stream entities from the given Aleph instance so that they can be written to a file or piped into another processing step:bulkload
command executes an entity mapping within the Aleph system. Its only argument is a YAML mapping file: