Input Output core module¶
KoswatImporterProtocol
¶
Bases: Protocol
import_from(from_path: Path) -> DataObjectModelProtocol | list[DataObjectModelProtocol]
¶
Generates a valid instance of a DataObjectModelProtocol based on the contents from the provided path.
| Parameters: |
|
|---|
| Returns: |
|
|---|
KoswatReaderProtocol
¶
Bases: Protocol
read(file_path: Path) -> FileObjectModelProtocol
¶
Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.
| Parameters: |
|
|---|
| Returns: |
|
|---|
supports_file(file_path: Path) -> bool
¶
Validates whether the current reader is capable of importing data from the provided file.
| Parameters: |
|
|---|
| Returns: |
|
|---|
KoswatWriterProtocol
¶
Bases: Protocol
write(fom_instance: FileObjectModelProtocol, to_path: Path) -> None
¶
Writes the data from the instance of a FileObjectModelProtocol to the to_path.
| Parameters: |
|
|---|
CSV module¶
KoswatCsvFomProtocol
¶
Bases: FileObjectModelProtocol, Protocol
is_valid() -> bool
¶
Validates the current structure of this KoswatCsvFomProtocol instance.
| Returns: |
|
|---|
INI module¶
KoswatIniFomProtocol
¶
Bases: FileObjectModelProtocol, Protocol
from_config(ini_config: ConfigParser) -> KoswatIniFomProtocol
classmethod
¶
Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance.
| Parameters: |
|
|---|
| Returns: |
|
|---|
TXT module¶
KoswatTxtFomProtocol
¶
Bases: FileObjectModelProtocol, Protocol
from_text(file_text: str) -> KoswatTxtFomProtocol
classmethod
¶
Imports all the data stored in text form.
| Parameters: |
|
|---|
| Returns: |
|
|---|