Skip to content

feat(python): expose FLATFILES on the PyO3 client #435

@userFRM

Description

@userFRM

Problem

sdks/python/src/lib.rs and historical_methods.rs have no FLATFILES bindings. Python users on the option-flatfile bundle have no way to pull a daily blob from the SDK.

Proposed solution

Add async methods on ThetaDataDx:

  • await tdx.flatfile_request(sec_type, req_type, date, output_path, format)
  • await tdx.flatfile_request_decoded(sec_type, req_type, date) — returns a list of typed row dicts. Add an Arrow path (to_arrow()) consistent with the existing tick story so Pandas/Polars work without round-tripping through CSV.
  • await tdx.flatfile_request_raw(sec_type, req_type, date, output_path)
  • The 9 convenience methods.

Expose SecType, ReqType, FlatFileFormat enums in enums_generated.rs (PyO3 enum). Type-stub them in the .pyi file.

Impact

Python is the largest installed base. This is the binding most users will reach for first.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions