bzip2 module for Python

Paul Kunysch illume at gmx.net
Thu Apr 22 05:43:10 EDT 1999


Laurence Tratt <tratt at dcs.kcl.ac.uk> writes:

Hi

> [me 'announcing' pyBZlib]
> >> As I said, I am interested to know if there is a demand for this, so
> >> comments are appreciated.

>> IMHO it would be nice to have a module like the current "gzip", which
>> handles .bz2 .gz .Z and uncompressed files transparently.

> Do you mean you would like to see a module where you give it a file (which
> could be .bz2, .gz, .zip etc), and then get an uncompressed version back
> without worrying what compression type was used?

Yes.

Well, not ".zip", since it's an archive, and not a compressed file.
But please support plain uncompressed files, too. Why should a
programmer use different interfaces if one could do everything?

> Would you also want it to automatically untar files?

Didn't think about it. Depends on the syntax. If it's easy enough that
the user of our programs can specify some files as an tar-comonent
without breaking existing code, why not.

( "somewhere/webmirror.tar.bz2/index.html" ? )


Hiding the "bzlib-functions" in the "urllib" might be more usefull.
For example I'm currently playing around with Debian-Packages-files.
They describe the contents of FTP-Sites. I just have to read them
once, they could be located anywhere and they might be compressed.

Debian doesn't use bz2 right now, but if they decide to do so in a
year or two (when all computers have enough RAM) it would be great if
a user could still use the old python-scripts. In a perfect world the
this code ...

  file = sys.stdin.readline()
  fd = urllib.open(file)

... should work with "text" and with "rdist://some.ipv6.url/text.bz2"
as input. We might expect from the user that he installs some modules
(for uncommon things) but it would be nice if they would use the same
interface.


Bye




More information about the Python-list mailing list