frejanordsiek / hdf5storage

Python package to read and write a wide range of Python types to/from HDF5 formatted files. Can read/write data to the HDF5 based Matlab v7.3 MAT files.
BSD 2-Clause "Simplified" License
82 stars 24 forks source link

Adding read/write support for paths from pathlib #94

Open frejanordsiek opened 4 years ago

frejanordsiek commented 4 years ago

Adding read/write support for paths from pathlib (https://docs.python.org/3/library/pathlib.html). Since the package depends on this module now, it doesn't hurt to add the ability to marshal them. Unfortunately, only one of PosixPath and WindowsPath will be available on a particular system (and the other one not) and Path is essentially an alias for that one. This means that they cannot always be read back perfectly on a system different than the one that wrote them, but they can be converted to the next closest thing in such cases.