Skip to main content

Crate paft

Crate paft 

Source
Expand description

Unified public API for the paft workspace.

This facade crate aggregates the paft ecosystem into a single dependency with coherent feature flags and a convenient prelude for common imports.

Features

  • domain, market, fundamentals, aggregates: opt into the areas you need
  • prediction: prediction market identity, metadata, quotes, books, and trades
  • bigdecimal: change the money backend from rust_decimal to bigdecimal
  • dataframe: enable DataFrame export via Polars helpers
  • panicking-money-ops: opt‑in operator overloading for Money that panics on invalid input
  • money-formatting: locale‑aware money formatting and parsing
  • tracing: lightweight instrumentation; zero‑cost when disabled

§Quickstart

use paft::prelude::*;

// Construct an instrument with identifiers
let aapl = Instrument::from_symbol_and_exchange("AAPL", Exchange::NASDAQ, AssetKind::Equity)
    .unwrap();

// Build a validated history request
let req = HistoryRequest::try_from_range(Range::M1, Interval::D1).unwrap();
assert_eq!(req.interval(), Interval::D1);

See the crate README for installation instructions and feature details.

§Wire compatibility policy

Serde boundaries are strict for requests, configuration, and semantic metadata shapes where silently dropping fields could change meaning. A kind discriminator alone does not make a data payload strict. Provider/data payload models are forward-compatible by default: unmodeled JSON fields are ignored unless validation requires rejection. Generic provider metadata is serde-flattened into the owning JSON object, so colliding JSON field names are unsupported. DataFrame export is separately namespaced under provider.* columns.

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

aggregates
Namespaced access to paft-aggregates (feature-gated).
core
Namespaced access to paft-core.
dataframe
Top-level re-export of the dataframe runtime traits used by paft-owned types. For deriving dataframe support on your own structs, depend on df-derive directly. DataFrame conversion traits for paft utilities.
domain
Namespaced access to paft-domain (feature-gated).
error
Unified error types for the paft facade crate.
fundamentals
Namespaced access to paft-fundamentals (feature-gated).
market
Namespaced access to paft-market (feature-gated).
money
Namespaced access to paft-money types.
prediction
Namespaced access to paft-prediction (feature-gated).
prelude
Frequently used types for convenient imports. Commonly used types for convenient glob import.

Structs§

Decimal
Direct access to decimal types. A big decimal type.
DecimalConstraintError
Direct access to decimal types. Error returned when a decimal does not satisfy a constrained decimal type.
NonNegativeDecimal
Direct access to decimal types. Decimal constrained to x >= 0.
PositiveDecimal
Direct access to decimal types. Decimal constrained to x > 0.
Ratio
Direct access to decimal types. Decimal constrained to 0 <= x <= 1.

Enums§

RoundingStrategy
Direct access to decimal types. Rounding strategy supported by decimal operations.

Constants§

MAX_CANONICAL_TOKEN_LEN
Maximum byte length of a canonical Other enum token.