| Crates.io | paft-domain |
| lib.rs | paft-domain |
| version | 0.7.1 |
| created_at | 2025-10-02 11:39:27.551043+00 |
| updated_at | 2025-10-31 17:56:06.980507+00 |
| description | Domain modeling primitives (instrument, exchange, period, market state) for the paft ecosystem. |
| homepage | |
| repository | https://github.com/paft-rs/paft |
| max_upload_size | |
| id | 1864276 |
| size | 122,570 |
Domain modeling primitives for the paft ecosystem: instruments, exchanges, periods, and market state.
Isin, Figi) with enforced validationInstrument with hierarchical identifiers (FIGI → ISIN → Symbol@Exchange → Symbol)Exchange, AssetKind, MarketState)Period parsing for quarters, years, and dates with a canonical wire formatPrefer the facade crate for most applications:
[dependencies]
paft = "0.7.1"
Advanced (direct dependency, minimal):
[dependencies]
paft-domain = { version = "0.7.1", default-features = false }
Alternate decimal backend: enable on dependent crates (e.g., via the facade):
[dependencies]
paft = { version = "0.7.1", features = ["bigdecimal"] }
Enable DataFrame helpers as needed:
[dependencies]
paft-domain = { version = "0.7.1", default-features = false, features = ["dataframe"] }
bigdecimal: change money backend from rust_decimal to bigdecimal via paft-moneydataframe: enable DataFrame traits for Polars integrationuse paft_domain::{Instrument, AssetKind, Exchange, Period};
// Instrument with optional global identifiers
let aapl = Instrument::try_new(
"AAPL",
AssetKind::Equity,
Some("BBG000B9XRY4"), // FIGI
Some("US0378331005"), // ISIN
Some(Exchange::NASDAQ),
).unwrap();
assert!(aapl.is_globally_identified());
assert_eq!(aapl.unique_key(), "BBG000B9XRY4");
// Period parsing with canonical output
let q4 = "2023-Q4".parse::<Period>().unwrap();
assert_eq!(q4.to_string(), "2023Q4");