ordeq_pandas
PandasCSV
dataclass
¶
Bases: IO[DataFrame]
IO to load from and save to CSV data using Pandas. Calls
pd.read_csv and pd.write_csv under the hood.
Example:
>>> import pandas as pd
>>> from pathlib import Path
>>> from ordeq_pandas import PandasCSV
>>> csv = PandasCSV(
... path=Path("path/to.csv")
... ).load(header="infer") # doctest: +SKIP
Load behaviour is configured by with_load_options:
>>> csv = PandasCSV(
... path=Path("path/to.csv")
... ).with_load_options(header="infer")
Save behaviour is configured by with_save_options:
>>> csv = PandasCSV(
... path=Path("path/to.csv"),
... ).with_save_options(header=True)
PandasExcel
dataclass
¶
Bases: IO[DataFrame]
IO to load from and save to Excel data using Pandas. Calls
pd.read_excel and pd.to_excel under the hood.
Example usage:
>>> from pathlib import Path
>>> from ordeq_pandas import PandasExcel
>>> xlsx = PandasExcel(
... path=Path("path/to.xlsx")
... ).load(usecols="A:C") # doctest: +SKIP
Load behaviour is configured by with_load_options:
>>> xlsx = (
... PandasExcel(
... path=Path("path/to.xlsx")
... )
... .with_load_options(usecols="A:C")
... )
PandasParquet
dataclass
¶
Bases: IO[DataFrame]
IO to load from and save to PARQUET data using Pandas. Calls
pd.read_parquet and pd.write_parquet under the hood.
Example usage:
>>> from pathlib import Path
>>> from ordeq_pandas import PandasParquet
>>> parquet = PandasParquet(
... path=Path("path/to.parquet")
... )