blueetl.store.base

Base data store.

Classes

BaseStore(basedir)

Abstract class defining a generic file data store.

class blueetl.store.base.BaseStore(basedir: str | PathLike)

Bases: ABC

Abstract class defining a generic file data store.

It’s responsible for reading and writing Pandas DataFrames in a specific serialization format.

Initialize the object.

Parameters:

basedir – base directory where the files should be stored.

property basedir: Path

Return the directory containing the files.

checksum(name: str) str | None

Return a checksum of the file, or None if it doesn’t exist.

delete(name: str) None

Delete the file with the given name and the class extension, if it exists.

abstract dump(df: DataFrame, name: str) None

Save a dataframe to file, using the given name and the class extension.

abstract property extension: str

Return the file extension to be used with this specific data store.

abstract load(name: str) DataFrame | None

Load a dataframe from file, using the given name and the class extension.

path(name: str) Path

Return the full path of the file with the given name and the class extension.

If name is empty, then return the base directory. This can be useful when working with partitioned DataFrames and directories containing multiple files.