call_report.fca.transport.FCATransport#
- class call_report.fca.transport.FCATransport(*args, **kwargs)[source]#
Bases:
ProtocolThe interface FCACallReport uses to resolve a period’s local files.
Any object implementing resolve can be passed as an FCACallReport’s
transport=argument. Two implementations ship with the package: LocalDirectoryTransport, for a user-supplied directory of already-extracted releases, and PackagedArchiveTransport, for the historical release zips checked into this repository.- resolve(*, period: ReportingPeriod) Path[source]#
Return a local directory containing a period’s extracted files.
Implementations may resolve this however they like, for instance by reading an already-extracted local directory or by downloading and extracting a zip archive on demand.
- Parameters:
- periodReportingPeriod
The period to resolve.
- Returns:
- pathlib.Path
A directory containing that period’s
D_*.TXTlayout files and their data files.
- Raises:
- DownloadError
If the period’s files cannot be resolved.