Schemas

Pandera DataFrameModel schemas for pyth-pandas DataFrame-returning endpoints.

Convention:

Every public method that returns a pd.DataFrame MUST have a corresponding DataFrameModel schema defined here and annotated as DataFrame[SomeSchema] in its return type. Integration tests validate live API responses against these schemas.

All schemas use strict=False (extra columns allowed) and coerce=True to avoid breaking when the upstream API adds new fields.

Column names reflect the post-preprocessing camelCase convention.

class pyth_pandas.schemas.ParsedFeedSchema(*args, **kwargs)[source]

Bases: _Lenient

Schema for one row of a parsed Pyth Pro feed update.

Source:

POST /v1/latest_price, POST /v1/price, POST /v1/reduce_price — specifically the parsed.priceFeeds[] array of each response.

Columns are post-preprocessing camelCase names. All numeric fields are raw mantissas — multiply by 10 ** exponent to get the human value.

Return type:

DataFrameBase[Self]

class Config

Bases: Config

name = 'ParsedFeedSchema'
bestAskPrice: float | None = 'bestAskPrice'
bestBidPrice: float | None = 'bestBidPrice'
confidence: float | None = 'confidence'
emaConfidence: float | None = 'emaConfidence'
emaPrice: float | None = 'emaPrice'
exponent: float | None = 'exponent'
feedUpdateTimestamp: Timestamp | None = 'feedUpdateTimestamp'
fundingRate: float | None = 'fundingRate'
fundingRateInterval: float | None = 'fundingRateInterval'
fundingTimestamp: Timestamp | None = 'fundingTimestamp'
marketSession: str | None = 'marketSession'
price: float | None = 'price'
priceFeedId: int = 'priceFeedId'
publisherCount: float | None = 'publisherCount'