fsspec / fsspec/filesystem_spec

Register custom compression types via entrypoint mechanism

Open
#1,187 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

While new fsspec-compatible filesystem can easily be registered via fsspec.specs entry points, there is no counterpart for compression types.

As we already have the fsspec.compression.register_compression public API for custom compression types, it wouldn't be too much burden (and give better user experience as a universal filesystem interface) to implement entrypoint support for custom compression types.

THOUGHTS.

register_compression takes two names(in addition to the (de-)compressor callable): algorithm name(e.g. gzip) and file extension(e.g. gz). Receiving both names via entrypoint is not impossible (simple parsing in mind) but may not be desirable from aesthetic viewpoint. In any case registration with whatever the preferred name can still be beneficial, as users will be able to specify the compression method via simple string argument, e.g. fsspec.open(..., compression=compression), without import-and-call register_compression manually.

(BTW this feature request comes after my reading a bunch of zlib-compressed csv files. I just found that zlib is not supported in fsspec and can be implemented in almost identical manner as how snappy is implemented.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing fsspec.specs entry-point support and the register_compression public API. Resolve how entry points provide the algorithm and file-extension names, then verify that an installed custom compression type can be selected through fsspec.open(..., compression=...). The issue is complete when registration works without manually calling register_compression.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.