[feature request] Discover and load compression plugins
See original GitHub issueAs mentioned in #2161 and https://github.com/h5py/h5py/issues/928#issuecomment-353715290, the official way for packages to support plugins is using entry points.
By officially supporting plugins that register new compression schemes, unpythonic and error prone mechanisms like hdf5plugin
modifying h5py’s global variables state on import can be avoided.
hdf5plugin plugin could then register itself e.g. like this:
[project.entry-points.'h5py.compression']
lz4 = 'hdf5plugin:LZ4'
zstd = 'hdf5plugin:Zstd'
While h5py
loads their projects:
from collections import ChainMap
from importlib.metadata import entry_points
FILTERS_BUILTIN = {'gzip': ..., 'lzf': ..., 'szip': ...}
FILTERS_PLUGIN = {ep.name: ep.load() for ep in entry_points(group='h5py.compression')}
FILTERS = ChainMap(FILTERS_BUILTIN, FILTERS_PLUGIN)
Issue Analytics
- State:
- Created a year ago
- Comments:27 (22 by maintainers)
Top Results From Across the Web
Provide a interface for registering filter plugins #928 - GitHub
Provide a interface for registering filter plugins #928 ... [feature request] Discover and load compression plugins #2163.
Read more >Smush – Lazy Load Images, Optimize & Compress Images
Compress images & optimize images with lazy load, WebP conversion, and resize detection to make your site load amazingly fast.
Read more >11 Best Free Compressor Plugins 2022 (VCA, Vari-Mu, FET ...
In this article, we enlist and review the 11 Best Free Compressor Plugins available in 2022. Find the perfect compressor for mastering and...
Read more >6 Best WordPress Image Optimizer Plugins (Tested and ...
ShortPixel Image Optimizer; Optimole; Imagify; EWWW Image Optimizer; Compress JPEG & PNG images by TinyPNG; Smush Image Compression and ...
Read more >Highcompress Image Compressor plugin for Wordpress
Highcompress is a tool to compress images without loosing quality powered by Deep learning. We have added many feature other than compression on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It would be so simple if the work done by
hdf5plugin
developers could be made by the HDF Group …h5py
andhdf5plugin
are constrained bylibhdf5
API and behaviour (as any library wrappers), so it’s not always easy/possible to be Pythonic.Now to focus on entry point/behaviour issue, from
hdf5plugin
side:h5py
dev team is taking this way.import hdf5plugin
loading HDF5 filters for e.g.,import hdf5plugin; hdf5plugin.load_filters()
.