Aleph

How To Export FollowTheMoney Data

In some cases you may want to process FollowTheMoney entities outside of Aleph. This guide describes how you can use the alephclient CLI to export all entities or a subset of entities in the FollowTheMoney format or as a CSV or Excel file.

  1. This guide uses the alephclient CLI to export FollowTheMoney data from Aleph and the ftm CLI to convert FollowTheMoney data to CSV or Excel files. If you don’t have these two CLIs installed, please refer to How to install the ftm CLI and How to install the alephclient CLI for installation instructions.

  2. Using the alephclient CLI, you can stream entities from an Aleph collection and write them to a file:

    alephclient stream-entities --foreign-id 0bdf... --outfile entities.json

    Replace 0bdf... with the foreign ID of your collection. You can find a collection’s foreign ID in the Aleph UI. Navigate to the collection homepage. The foreign ID is listed in the sidebar on the right.

    Streaming very large collections from an Aleph instance is a resource-consuming activity on the server side. Please only stream collections with more than 100,000 entities after making sure that the server administrators are OK with it.

    You can also filter entities by one or more schemata. The following command exports only Company entities:

    alephclient stream-entities --foreign-id 0bdf... --schema Company --outfile companies.json
  3. Optionally, you can now use the ftm CLI to convert the FollowTheMoney data exported in the previous step to CSV or Excel file formats:

    # Generates one CSV file per schema
    ftm export-csv --infile entities.json --outdir ./entities
    
    # Generates one Excel file with one sheet per schema
    ftm export-excel --infile entities.json --outfile entities.xlsx

    When exporting to the Excel format, it’s easy to generate a workbook larger than what Microsoft Excel and similar office programs can actually open. Only export small and mid-size datasets.

    You can also combine both commands in a single step:

    alephclient stream-entities -f 0bdf... -s Company | ftm export-excel -o entities.xlsx