iati-transform
Transformations and rollups for IATI Activity data.
Part of theiati-cratesecosystem.
Overview
This crate provides pure, IO-free transformations for iati-types data structures —
designed for use in CLI tools, web services, and data pipelines.
Core functions
- Aggregate transactions by type, year, or currency
- Respect currency fallback (
transaction.currency→activity.default_currency) - Simple, functional design — no I/O, no side effects
- Works seamlessly with
iati-xmlfor parsed IATI data
Example
use ;
use ;
use NaiveDate;
use Decimal;
// Build a minimal IATI Activity
let mut a = new;
a.default_currency = Some;
a.transactions.push;
a.transactions.push;
// Aggregate by type in native currency space (no FX conversions)
let sums = aggregate_by_type;
let total_usd = sums.total_for;
assert!;
// Aggregate by year and transaction type
let year_sums = aggregate_by_year_and_type;
assert!;