pibrary.file
Classes
Class to read and write files. |
Module Contents
- class pibrary.file.File(path: str, *args, **kwargs)[source]
Class to read and write files.
- read() File[source]
Sets the io mode to read, and path variable to read from.
Returns: Class object to chain with other methods.
- write(obj_file: Any) File[source]
Sets the io mode to write, and path variable to write to.
- Parameters:
obj_file – Object to save like dict for j
Returns: Class object to chain with other methods.
- json(**kwargs) Dict[str, List[str]] | None[source]
Reads or writes json file according to mode set by read/write method.
- Parameters:
**kwargs – Keyword arguments for diff read/write like. Eg:nt=4 for json read.
Returns: obj_file if read mode else nothing is returned.