pycsamt.io
Input/output configuration and parser helpers.
Unified readers, writers, and configuration-file I/O.
-
class pycsamt.io.Config
Bases: object
Container of un‐modifiable I/O settings and lookup tables.
-
property parsers: dict[str, callable]
Mapping of file extensions → pandas reader functions.
-
static writers(obj)
Mapping of file extensions → DataFrame writer methods.
Pass in the DataFrame (or similar) instance as obj.
- Return type:
dict[str, callable]
-
pycsamt.io.read_any(path, **kwargs)
Read a table‐like file into a pandas object using the Config parser map.
- Parameters:
path (str) – Path to file. Extension must be one of Config().parsers.keys().
**kwargs – Passed directly to the pandas reader (e.g. sep, sheet_name,
parse_dates, etc.)
- Return type:
DataFrame or similar
-
pycsamt.io.write_any(obj, path, **kwargs)
Write a pandas‐like object to disk using Config writers.
- Parameters:
obj (pandas.DataFrame or similar)
path (str) – Output path with one of the Config.writers() extensions.
**kwargs – Passed directly to the pandas writer (e.g. index, compression, etc.)