Skip to content

opensanctions/ftm-inspect

Repository files navigation

ftm-stmt

TUI diff tool for zavod statements.pack files. Lets you diff two arbitrary .pack files against each other

Installation

alias ftm-stmt="uvx --from git+https://github.com/opensanctions/ftm-inspect.git ftm-stmt"

If you get compilation errors related to pyICU, see the zavod install docs for how to set the correct magic environment variables (ideally at shell startup).

Running

ftm-stmt diff LEFT RIGHT

Example

ftm-stmt diff https://data.opensanctions.org/datasets/latest/us_ofac_sdn/statements.pack \
              data/datasets/us_ofac_sdn/statements.pack

Using with zavod and the OpenSanctions archive

If you're running zavod locally and want to diff your local output against the published archive, use zavod archive url to resolve the URL for you:

ftm-stmt diff $(zavod archive url statements.pack --latest datasets/us/ofac/us_ofac_sdn.yml) \
              data/datasets/us_ofac_sdn/statements.pack

If your dataset name is in $DATASET:

ftm-stmt diff $(zavod archive url statements.pack --latest datasets/**/$DATASET.yml) \
              data/datasets/$DATASET/statements.pack

Diff output with delta

The -o diff flag outputs a standard unified diff that you can pipe to delta (brew install git-delta) for syntax-highlighted output:

ftm-stmt diff -o diff $(zavod archive url statements.pack --latest datasets/**/$DATASET.yml) \
                      data/datasets/$DATASET/statements.pack | delta

delta diff output

TUI keybindings

Key Action
t Toggle truncation
w Toggle word wrap
/ Search
n / N Next / previous match
q / Esc Quit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages