- Fix out-of-memory issue when computing file ID hashes of large files.
- Replace usage of
distutils.dir_util.mkpath
withos.path.makedirs
.
- Use
shutil.move
instead ofshutil.copy
to move temporary file created duringput
operation toHashFS
directory.
- Add faster
scandir
package for iterating over files/folders when platform is Python < 3.5. Scandir implementation was added toos
module starting with Python 3.5.
- Rename private method
HashFS.copy
toHashFS._copy
. - Add
is_duplicate
attribute toHashAddress
. - Make
HashFS.put()
returnHashAddress
withis_duplicate=True
when file with same hash already exists on disk.
- Add
HashFS.size()
method that returns the size of all files in bytes. - Add
HashFS.count()
/HashFS.__len__()
methods that return the count of all files. - Add
HashFS.__iter__()
method to support iteration. Proxies toHashFS.files()
. - Add
HashFS.__contains__()
method to supportin
operator. Proxies toHashFS.exists()
. - Don't create the root directory (if it doesn't exist) until at least one file has been added.
- Fix
HashFS.repair()
not usingextensions
argument properly.
- Rename
HashFS.length
parameter/property towidth
. (breaking change)
- Rename
HashFS.get
toHashFS.open
. (breaking change) - Add
HashFS.get()
method that returns aHashAddress
orNone
given a file ID or path.
- Add
HashFS.get()
method that retrieves a reader object given a file ID or path. - Add
HashFS.delete()
method that deletes a file ID or path. - Add
HashFS.folders()
method that returns the folder paths that directly contain files (i.e. subpaths that only contain folders are ignored). - Add
HashFS.detokenize()
method that returns the file ID contained in a file path. - Add
HashFS.repair()
method that reindexes any files under root directory whose file path doesn't not match its tokenized file ID. - Rename
Address
classs toHashAddress
. (breaking change) - Rename
HashAddress.digest
toHashAddress.id
. (breaking change) - Rename
HashAddress.path
toHashAddress.abspath
. (breaking change) - Add
HashAddress.relpath
which represents path relative toHashFS.root
.
- First release.
- Add
HashFS
class. - Add
HashFS.put()
method that saves a file path or file-like object by content hash. - Add
HashFS.files()
method that returns all files under root directory. - Add
HashFS.exists()
which checks either a file hash or file path for existence.