Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for using Compress/Decompress? #1775

Open
gaby opened this issue Jan 17, 2025 · 4 comments
Open

Documentation for using Compress/Decompress? #1775

gaby opened this issue Jan 17, 2025 · 4 comments

Comments

@gaby
Copy link

gaby commented Jan 17, 2025

I noticed that fsspec has fsspec.compression but it's not documented anywhere how to use it. Even a simple example would help on how to create a fs using fsspec and write files compressed to it.

The other thing I read is that fsspec doesn't have compression dependencies, if I want to use zstd, which package am I suppose to add for that to work with fsspec ?

@martindurant
Copy link
Member

The code is reached via the compression= kwargs in fsspec.open:

    compression: string or None
        If given, open file using compression codec. Can either be a compression
        name (a key in ``fsspec.compression.compr``) or "infer" to guess the
        compression from the filename suffix.

For Zstd, the import is zstandard, but you are right, documentation on what these are and what to do when requesting a compression that is known but not installed would be very useful. Would you like to work on this?

@gaby
Copy link
Author

gaby commented Jan 22, 2025

That means the filesystem perse is compressed? How about individual files is that something filesystem_spec supports or should I use something else to compress the file then add it to a fsspec/filesystem_spec ?

@martindurant
Copy link
Member

Yes, this is for opening individual files.

the filesystem perse is compressed

Sorry, I didn't understand this.

@gaby
Copy link
Author

gaby commented Jan 30, 2025

Yes, this is for opening individual files.

the filesystem perse is compressed

Sorry, I didn't understand this.

I have no idea what I wrote. Haha. I will let someone else document this, there's a lot of sections missing docs, so I can't really track what to put where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants