agglovar.io
I/O utilities.
Classes
Read a plain or a gzipped file using context guard. |
Module Contents
- class agglovar.io.PlainOrGzReader
Read a plain or a gzipped file using context guard.
- Parameters:
file_path – File path or file name.
mode – File open mode.
is_gz – If None, determine if file is gzipped based on the file name. Set to True to force reading gzipped, False to force reading plain.
Example:
with PlainOrGzReader('path/to/file.gz'): ...
- __enter__()
Enter context.
- __exit__(exc_type, exc_value, traceback)
Exit context.
- __post_init__()
Post initialization.
- file_path: str | pathlib.Path