Skip to main content

Crate paft_fundamentals

Crate paft_fundamentals 

Source
Expand description

Fundamentals types for financial statements, analysis, holders, and ESG.

Provider-agnostic, strongly-typed models for company/fund profiles, ownership, analyst coverage, and financial statements used across the paft ecosystem. Types prefer canonical string forms for serde/display and validated builders where appropriate.

§Quickstart

use paft_fundamentals::{Earnings, EarningsYear, Profile, CompanyProfile};

let earnings = Earnings {
    yearly: vec![EarningsYear::new(2023).unwrap()],
    quarterly: vec![],
    quarterly_eps: vec![],
};
assert_eq!(earnings.yearly[0].year.get(), 2023);

let profile = Profile::Company(CompanyProfile {
    name: "Example Corp".to_string(),
    sector: Some("Technology".to_string()),
    industry: None,
    website: None,
    address: None,
    summary: None,
    isin: None,
});
match profile {
    Profile::Company(c) => assert_eq!(c.name, "Example Corp"),
    _ => unreachable!(),
}

§Feature flags

The default money backend is rust_decimal.

  • bigdecimal: switch paft-money to the bigdecimal backend
  • dataframe: enable polars/df-derive-macros integration for dataframe export

§Serde

All models serialize with stable, human-readable representations; dataframe support emits string codes for enums.

Re-exports§

pub use analysis::AnalysisSummary;
pub use analysis::Earnings;
pub use analysis::EarningsEstimate;
pub use analysis::EarningsQuarter;
pub use analysis::EarningsQuarterEps;
pub use analysis::EarningsTrendRow;
pub use analysis::EarningsYear;
pub use analysis::EpsRevisions;
pub use analysis::EpsTrend;
pub use analysis::OtherRecommendationAction;
pub use analysis::OtherRecommendationGrade;
pub use analysis::PriceTarget;
pub use analysis::RecommendationAction;
pub use analysis::RecommendationGrade;
pub use analysis::RecommendationRow;
pub use analysis::RecommendationSummary;
pub use analysis::RevenueEstimate;
pub use analysis::RevisionPoint;
pub use analysis::TrendPoint;
pub use analysis::UpgradeDowngradeRow;
pub use error::FundamentalsError;
pub use esg::EsgInvolvement;
pub use esg::EsgScores;
pub use esg::EsgSummary;
pub use holders::InsiderPosition;
pub use holders::InsiderRosterHolder;
pub use holders::InsiderTransaction;
pub use holders::InstitutionalHolder;
pub use holders::MajorHolder;
pub use holders::NetSharePurchaseActivity;
pub use holders::OtherInsiderPosition;
pub use holders::OtherTransactionType;
pub use holders::TransactionType;
pub use profile::Address;
pub use profile::CompanyProfile;
pub use profile::FundKind;
pub use profile::FundProfile;
pub use profile::OtherFundKind;
pub use profile::Profile;
pub use profile::ShareCount;
pub use statements::BalanceSheetRow;
pub use statements::Calendar;
pub use statements::CashflowRow;
pub use statements::IncomeStatementRow;
pub use statistics::KeyStatistics;

Modules§

analysis
Analyst, recommendations, and earnings-related types under paft_fundamentals::analysis.
error
Error types for paft-fundamentals.
esg
ESG scores and involvement types.
holders
Holder, insider activity, and ownership summary types.
profile
Profile-related types under paft_fundamentals::profile.
statements
Financial statements and calendar types under paft_fundamentals::statements.
statistics
Key statistics: slow-moving valuation, dividend, and risk metrics associated with an instrument.