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

inspiration/ideas for kompress #10

Open
karlicoss opened this issue Apr 14, 2020 · 7 comments
Open

inspiration/ideas for kompress #10

karlicoss opened this issue Apr 14, 2020 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@karlicoss
Copy link
Owner

karlicoss commented Apr 14, 2020

Ideally I want something like pathlib.Path, but also supporting archives. Ideally it would be transparent, so for the data consumer it doesn't matter if the file is compressed or not.

At the moment I'm using a helper. It's a bit crude, but mostly works. Would be nice to replace it with a proper library though, that's worth extra dependency.

Potential candidates:

Some relevant discussions:

Related:

@karlicoss
Copy link
Owner Author

This looks interesting https://github.com/PyFilesystem/pyfilesystem2

@karlicoss
Copy link
Owner Author

Interesting enough, there are some useful functions in the standard library

https://docs.python.org/3/library/shutil.html#shutil.unpack_archive
https://docs.python.org/3/library/tarfile.html#tarfile.open

However seems that it only supports .tar packed files, so not possible to use it as a handy universal file extractor

karlicoss referenced this issue in karlicoss/HPI Apr 14, 2022
this way you don't have to unpack it first and can work as if it's a 'virtual' directory

related: https://github.com/karlicoss/HPI/issues/20
karlicoss referenced this issue in karlicoss/HPI Apr 14, 2022
* core: add ZipPath encapsulating compressed zip files

this way you don't have to unpack it first and can work as if it's a 'virtual' directory

related: https://github.com/karlicoss/HPI/issues/20
karlicoss referenced this issue in karlicoss/HPI May 31, 2022
potentially will extract some common interface here like ZipPath

relevant to https://github.com/karlicoss/HPI/issues/20
karlicoss referenced this issue in karlicoss/HPI May 31, 2022
potentially will extract some common interface here like ZipPath

relevant to https://github.com/karlicoss/HPI/issues/20
@karlicoss
Copy link
Owner Author

Actually tarfile isn't too bad, seems that it's capable of guessing compression and the interface is okay. So might be possible to have a short wrapper similar to ZipPath if there are more tar.gz exports karlicoss/HPI@5799c06

@karlicoss
Copy link
Owner Author

Btw seems that there's been some interesting progress here, some great work towards making pathlib.Path more extensibe (although some thing are only available since python 3.12) https://discuss.python.org/t/make-pathlib-extensible

@karlicoss
Copy link
Owner Author

After a few years, seems that nothing like this exists, so started extracting in a library https://github.com/karlicoss/kompress

@karlicoss karlicoss transferred this issue from karlicoss/HPI Nov 3, 2023
@karlicoss karlicoss changed the title Find a library for accessing compressed files inspiration/ideas for kompress Nov 3, 2023
@karlicoss
Copy link
Owner Author

transferred the issue since it has some useful links here

@karlicoss
Copy link
Owner Author

went through the thread linked above to catch up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant