#polars-dataframe #dataframe #market-data #polars #serde

paft-core

Core domain types, errors, and shared utilities for paft

12 releases (6 breaking)

Uses new Rust 2024

0.7.1 Oct 31, 2025
0.7.0 Oct 28, 2025
0.6.0 Oct 21, 2025
0.5.2 Oct 19, 2025
0.1.0 Sep 15, 2025

#583 in Finance

Download history 634/week @ 2025-10-16 221/week @ 2025-10-23 86/week @ 2025-10-30 30/week @ 2025-11-06 42/week @ 2025-11-13 32/week @ 2025-11-20 51/week @ 2025-11-27 25/week @ 2025-12-04 35/week @ 2025-12-11 97/week @ 2025-12-18 115/week @ 2025-12-25 96/week @ 2026-01-01 71/week @ 2026-01-08 66/week @ 2026-01-15 74/week @ 2026-01-22 181/week @ 2026-01-29

397 downloads per month
Used in 12 crates (4 directly)

MIT license

18KB
279 lines

paft-core

Core infrastructure utilities for the paft ecosystem.

Crates.io Docs.rs

  • Workspace-wide error type (PaftError)
  • Enum macros for canonical string codes (string_enum_*, impl_display_via_code)
  • Reusable serde helpers for timestamp encodings
  • Optional re-exports for lightweight DataFrame traits

Install

Prefer the facade crate for most applications:

[dependencies]
paft = "0.7.1"

Advanced (direct dependency, minimal):

[dependencies]
paft-core = { version = "0.7.1", default-features = false }

With serde helpers only (no optional features available in this crate):

[dependencies]
paft-core = { version = "0.7.1", default-features = false }

Features

This crate does not expose optional features as of 0.5.2. DataFrame traits now live in paft-utils and are forwarded by consumer crates (or the paft facade) via their own dataframe features.

Quickstart

use paft_core::{PaftError, string_enum_closed_with_code, impl_display_via_code};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
enum Side { Buy, Sell }

paft_core::string_enum_closed_with_code!(
    Side, "Side",
    { "BUY" => Side::Buy, "SELL" => Side::Sell }
);
paft_core::impl_display_via_code!(Side);

assert_eq!(Side::Buy.code(), "BUY");
assert_eq!("sell".parse::<Side>().unwrap(), Side::Sell);
assert!(matches!("".parse::<Side>(), Err(PaftError::InvalidEnumValue { .. })));

Dependencies

~1.2–2.1MB
~39K SLoC