API#
This is the API reference for call-report. See Get Started for
a task-oriented introduction to the same functionality.
Package configuration#
Controls which dataframe library every reader returns native frames of, and whether they are returned eager or lazy.
Return a copy of the current thread's package configuration. |
|
Update the current thread's package configuration. |
|
Temporarily change the package configuration within a |
Core#
Shared, source-agnostic building blocks: the quarter-end reporting-period vocabulary, the cross-time schema vocabulary, the cross-source enums, the dataframe vocabulary every reader returns, and the abstract base every source-specific entry point implements.
A single calendar-quarter reporting period. |
|
An inclusive, contiguous sequence of quarterly ReportingPeriods. |
|
A calendar quarter, ordered Q1 (Jan-Mar) through Q4 (Oct-Dec). |
|
A regulatory call report source supported (or planned) by this package. |
|
The kind of file within a call report release. |
|
Abstract base for every source-specific call report entry point. |
|
One span of a field's history where its dtype and definition held constant. |
|
Cross-time metadata for a single field within a call report file. |
|
An ordered, immutable mapping of field name to FieldAttributes. |
|
One field's before/after metadata between two FieldSchema snapshots. |
|
The result of comparing two FieldSchema snapshots via FieldSchema.compare. |
|
Cross-time metadata for a single call report file (schedule). |
|
The result of comparing two FileMetadata via FileMetadata.compare. |
Dataframe types#
The two type aliases that describe what a reader hands back. Both are
importable from call_report.core for annotating your own code. They are
written out here rather than generated, because a type alias has no runtime
object for autodoc to read a docstring from.
- call_report.core.NativeDataFrame#
The closed set of native dataframe types this package returns.
Every function and method that produces tabular data returns one of
pandas.DataFrame,pyarrow.Table,polars.DataFrame, orpolars.LazyFrame, never anarwhalswrapper. Which one you get is decided by thedataframe_backendandlazysettings (seecall_report.config.set_config()), or by an explicitdataframe_typeargument at the call site.
- call_report.core.DataFrameType#
The names a caller requests a specific native dataframe type by.
One of
"pandas","pyarrow_table","polars_dataframe", or"polars_lazyframe". Every method that builds a frame takes adataframe_typeargument accepting one of these values, applied as a final step whatever backend produced the frame. That lets a caller ask for a pandas DataFrame while the package is configured to use polars.Nonereturns the frame as the configured backend built it.
Exceptions#
The exception hierarchy shared across sources.
Root of every domain-specific error raised by call_report. |
|
A supplied period value is malformed or not a real calendar quarter end. |
|
A period is a valid quarter end but the source does not publish it. |
|
A requested schedule is unknown, or absent from every requested period. |
|
A requested curated domain dataset is not one this package ships. |
|
A layout or data file could not be parsed into the expected shape. |
|
A release's files could not be resolved or retrieved. |
|
Loaded schedule data could not be reshaped into the requested layout. |
FCA Call Report#
FCACallReport is the main entry point; the other members below are the
lower-level building blocks it’s composed from, useful on their own for
parsing an individual layout or data file.
The estimator-style entry point for FCA Call Report data. |
|
A Farm Credit Administration Call Report schedule. |
|
A curated domain dataset this package ships for FCA Call Report data. |
|
A curated view assembled from several FCA Call Report schedules. |
|
One group of schedules contributing to a curated domain dataset. |
|
One source variable's contribution to a curated domain dataset. |
|
One row key value in a curated domain dataset. |
|
One output column computed from other output columns. |
|
Convert an already-built wide-format frame to long format. |
|
Convert an already-built long-format frame to wide format. |
|
Convert an already-built long-format frame to the code grain. |
|
Return one curated domain dataset's shipped definition. |
|
Return a curated domain dataset's codes and what each one means. |
|
Return the canonical FileMetadata for one FCA schedule. |
|
Return the canonical FileMetadata for the FCA institution roster. |
|
Return every FCA schedule's canonical FileMetadata, keyed by FCASchedule. |
|
Construct the FCA download URL for a period's Call Report zip archive. |
|
Parse a |
|
A parsed FCA layout, with its scenario, variables, and column groups. |
|
Translate an FCA layout variable's declared type into a narwhals dtype. |
|
Parse a schedule's data file into a tidy native dataframe. |
|
Parse a release's institution roster into a native dataframe. |
|
The interface FCACallReport uses to resolve a period's local files. |
|
A transport that resolves periods to pre-extracted local directories. |
|
A transport that resolves periods to the release zips shipped in |