I've started a new Python project: hashfs
A content-addressable file management system for Python
The major features of HashFS are
- Files are stored once and never duplicated.
- Uses an efficient folder structure optimized for a large number of files. File paths are based on the content hash and are nested based on the first n number of characters.
- Can save files from local file paths or readable objects (open file handlers, IO buffers, etc).
- Able to repair the root folder by reindexing all files. Useful if the hashing algorithm or folder structure options change or to initialize existing files.
- Supports any hashing algorithm available via hashlib.new.
- Python 2.7+/3.3+ compatible.
Verify v1.0.0 has been released.
It was the first major release which now solidifies the public API. There were several breaking changes along the way but iteration was much quicker than some of my other projects (1 week from v0.0.0 to v1.0.0).
There are currently 71 validation methods and two styles of assertion runners: positional arguments and method chaining. There are no immediate plans to add additional validators but feature requests are welcome.
This is part four in my series on Generative Classes.
In part three of this series, Late Value Passing for Lazy Method Chaining in Python, I covered a methodology for creating reusable, ad-hoc functions from chained methods by passing the initial chain value late (i.e. after the method chain had been built up). In this post I will outline a way to replace the initial chain value by returning a clone of the method chains reinitialized with the replacement value.