The Beast
A flexible, declarative toolkit for transforming machine-readable data into FollowTheMoney (FTM) entities.
The Beast is currently in beta and is battle-tested in production on hundreds of data sources. While the mapping format may evolve for better flexibility, changes are introduced cautiously.
Installation
pip install thebeast
Quick Start
- Write a YAML mapping that describes how to read your source data and transform it into FTM entities.
- Run the mapping:
beast mapping.yaml
- Or sample a small fraction first:
beast-sample mapping.yaml --fraction 0.01
Features
- Declarative YAML mappings - define data transformations without writing code
- Multiple input formats - CSV, TSV, JSON, JSONL, with support for compressed and remote files (via
smart_open) - Rich property pipelines - column extraction, literals, Jinja2 templates, regex operations, transformers, augmentors
- Nested collections - handle hierarchical data with JMESPath traversal
- Statement metadata - attach provenance at dataset, collection, or property level
- Multiprocessing - parallel digest for CPU-bound workloads
- Built-in transformers - date parsing, phone/email normalization, transliteration, and more
- FTM schema validation - entities are validated against FollowTheMoney schemas
- Custom FTM ontologies - extend or replace the standard FTM model with your own schemas
Mapping Example
id: my_dataset
ingest:
cls: thebeast.ingest.CSVDictReader
params:
input_uri: ./people.csv
digest:
cls: thebeast.digest.SingleProcessDigestor
meta:
dataset: { literal: MY_DATASET }
collections:
persons:
path: "[@]"
entities:
person:
schema: Person
keys:
- record.id
properties:
name:
template: "{{ record.first }} {{ record.last }}"
birthDate:
column: birth
email:
column: emails
regex_split: "[;,]"
dump:
cls: thebeast.dump.StatementsCSVWriter
params:
output_uri: ./output.csv
error_uri: ./errors.csv
Documentation
Full documentation is available in docs/README.md, covering:
- Mapping format and all property operations
- Ingestors, digestors, and dumpers
- Statement metadata and provenance
- Nested collections and entity references
- Record and property transformers
- Sampling and testing workflows
Running Tests
pip install thebeast[dev]
python -m pytest thebeast/tests/ -v
License
MIT
Metadata
Release files for thebeast 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thebeast-0.5.0.tar.gz | 27.6 kB | Without provenance | Details for thebeast-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thebeast-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for thebeast-0.5.0-py3-none-any.whl |
Total release size: 60.9 kB
Release files / thebeast-0.5.0.tar.gz
| Download URL | thebeast-0.5.0.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b474042cdbd7e0a8a0f94fdbeb915b6bb4ed7ae326290d55aead259f2b3eaf64
|
|
BLAKE2b-256 checksum How to use checksums |
8b149fc50f15108201cf4cdc01a98ad8e907734cdbeea576c4976cd7188dbf26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / thebeast-0.5.0-py3-none-any.whl
| Download URL | thebeast-0.5.0-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2888e5138568225cb6b890fbed7542fc0e6e0be5d46bb2259bf917c0aa4c07f1
|
|
BLAKE2b-256 checksum How to use checksums |
ab611701be65cf44b763b8ca0fc95c8e613e4d938573675e65f6dea39f23614f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for thebeast 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.