PyQvd icon indicating copy to clipboard operation
PyQvd copied to clipboard

Support Python's Pathlib for IO

Open MuellerConstantin opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe. This library already supports reading and writing from/to file paths and IO streams (BinaryIO). Until now, Python's Pathlib isn't supported. File paths must be given as plain strings str, Path objects are not supported.

Describe the solution you'd like It would be great if all IO functions would accept Path objects as input as well. This seems to affect the following functions:

Example:

# Old
def to_qvd(self, path: str, options: "QvdFileWriterOptions" = None):
        """
        Persists the data table to a QVD file.

        :param path: The path to the QVD file.
        """
        ...

# New
def to_qvd(self, path: Union[str, Path], options: "QvdFileWriterOptions" = None):
        """
        Persists the data table to a QVD file.

        :param path: The path to the QVD file.
        """
        ...

Describe alternatives you've considered An alternative may be to transform the Path object to string str(path).

MuellerConstantin avatar Jan 05 '26 17:01 MuellerConstantin

hi, i would like to work on this, please assign it to me

blondedman avatar Jan 06 '26 07:01 blondedman

Sure, thank you for your effort.

MuellerConstantin avatar Jan 06 '26 12:01 MuellerConstantin

Solved thanks to @blondedman.

MuellerConstantin avatar Jan 06 '26 19:01 MuellerConstantin