paft_fundamentals/
lib.rs

1//! Fundamentals types for financial statements, analysis, holders, and ESG.
2//!
3//! Provider-agnostic, strongly-typed models for company/fund profiles,
4//! ownership, analyst coverage, and financial statements used across the paft
5//! ecosystem. Types prefer canonical string forms for serde/display and
6//! validated builders where appropriate.
7//!
8//! # Quickstart
9//! ```rust
10//! use paft_fundamentals::{Earnings, EarningsYear, Profile, CompanyProfile};
11//!
12//! let earnings = Earnings {
13//!     yearly: vec![EarningsYear { year: 2023, revenue: None, earnings: None }],
14//!     quarterly: vec![],
15//!     quarterly_eps: vec![],
16//! };
17//! assert_eq!(earnings.yearly[0].year, 2023);
18//!
19//! let profile = Profile::Company(CompanyProfile {
20//!     name: "Example Corp".to_string(),
21//!     sector: Some("Technology".to_string()),
22//!     industry: None,
23//!     website: None,
24//!     address: None,
25//!     summary: None,
26//!     isin: None,
27//! });
28//! match profile {
29//!     Profile::Company(c) => assert_eq!(c.name, "Example Corp"),
30//!     _ => unreachable!(),
31//! }
32//! ```
33//!
34//! # Feature flags
35//! - `rust-decimal` (default): `paft-money` uses `rust-decimal`
36//! - `bigdecimal`: `paft-money` uses `bigdecimal`
37//! - `dataframe`: enable `polars`/`df-derive` integration for dataframe export
38//!
39//! # Serde
40//! All models serialize with stable, human-readable representations; dataframe
41//! support emits string codes for enums.
42#![forbid(unsafe_code)]
43#![warn(missing_docs)]
44
45pub mod analysis;
46pub mod esg;
47pub mod holders;
48pub mod profile;
49pub mod statements;
50
51pub use analysis::{
52    AnalysisSummary, Earnings, EarningsQuarter, EarningsQuarterEps, EarningsTrendRow, EarningsYear,
53    PriceTarget, RecommendationAction, RecommendationGrade, RecommendationRow,
54    RecommendationSummary, UpgradeDowngradeRow,
55};
56pub use esg::{EsgInvolvement, EsgScores, EsgSummary};
57pub use holders::{
58    InsiderPosition, InsiderRosterHolder, InsiderTransaction, InstitutionalHolder, MajorHolder,
59    NetSharePurchaseActivity, TransactionType,
60};
61pub use profile::{Address, CompanyProfile, FundKind, FundProfile, Profile, ShareCount};
62pub use statements::{BalanceSheetRow, Calendar, CashflowRow, IncomeStatementRow};