ordeq_files
Bytes
dataclass
¶
Bases: IO[bytes]
IO representing bytes.
Example:
1 2 3 4 5 | |
Bz2
dataclass
¶
Bases: IO[bytes | str]
IO representing a bzip2-compressed file.
Example usage:
1 2 3 4 5 | |
CSV
dataclass
¶
Bases: IO[Iterable[Iterable[Any]]]
IO representing a CSV file.
Example usage:
1 2 3 4 5 | |
Example in a node:
1 2 3 4 5 6 7 8 | |
Example with a node generator:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Loading and saving can be configured with additional parameters, e.g:
1 2 3 4 | |
Refer to 1 for more details on the available options.
Glob
dataclass
¶
Bases: Input[Generator[PathLike, None, None]]
IO class that loads all paths provided a pattern.
Although this class can be used as dataset in your nodes,
for most cases it would be more suitable to inherit from
this class and extend the load method, for example:
1 2 3 4 5 | |
Gzip
dataclass
¶
Bases: IO[bytes | str]
IO representing a gzip-compressed file.
Example usage:
1 2 3 4 5 | |
JSON
dataclass
¶
Bases: IO[dict[str, Any]]
IO representing a JSON.
Example usage:
1 2 3 4 5 | |
Pickle
dataclass
¶
Bases: IO[T]
IO that loads and saves a Pickle files.
Example usage:
1 2 3 4 5 | |
Text
dataclass
¶
Bases: IO[str]
IO representing a plain-text file.
Examples:
1 2 3 4 5 | |
TextLinesStream
dataclass
¶
Bases: IO[Generator[str]]
IO representing a file stream as a generator of lines.
Useful for processing large files line-by-line.
By default, lines are separated by newline characters during load.
When saving, the newline character is appended to each line
by default, this can be changed by providing a different end argument
to the save method using with_save_options.
Examples:
1 2 3 4 5 6 7 8 9 | |
persist(data)
¶
Don't persist since is a stream-based IO.