Mailing List Archive

bzip2 module for Python
Is there a module for the bzip2 compression library available
or in the making ?

Thanks
Andreas
bzip2 module for Python [ In reply to ]
In message <Pine.GSO.4.10.9904190924420.14513-100000@saarland>
Andreas Jung <ajung@sz-sb.de> wrote:

> Is there a module for the bzip2 compression library available or in the
> making ?

I have put together a quick interface to the bzip2 compression system which
- for a couple of days or so - has a temporary home at:

http://yi.com/home/TrattLaurence/pybzlib.tar

I'm putting this out to see if there's any interest in developing it
further. At the moment, the module has two methods: 'compress' &
'decompress'.

It's not been tested much, but the main parts seem to work. As I said, I am
interested to know if there is a demand for this, so comments are
appreciated.


Laurie
bzip2 module for Python [ In reply to ]
Laurence Tratt <tratt@dcs.kcl.ac.uk> writes:

> 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.

Bye
bzip2 module for Python [ In reply to ]
In message <87zp43gaac.fsf@illusion.tui-net>
Paul Kunysch <illume@gmx.net> wrote:

[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.

pyBZlib handles .bz2 files 'transparently' as such, in that the inputs and
outputs to the bzip2 library are simply standard .bz2 files. The two simple
test files included with pyBZlib demonstrate this by slurping .bz2 files
straight into the libraries methods :)

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? Would you also want it to
automatically untar files?


Laurie
bzip2 module for Python [ In reply to ]
Hello!

On Tue, 20 Apr 1999, Laurence Tratt wrote:
> pyBZlib

What is it? Sounds good! Where is it?

> Laurie

Oleg.
----
Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/
Programmers don't die, they just GOSUB without RETURN.
bzip2 module for Python [ In reply to ]
In message <Pine.SOL2.3.96.SK.990420141622.19511H-100000@sun.med.ru>
Oleg Broytmann <phd@sun.med.ru> wrote:

> On Tue, 20 Apr 1999, Laurence Tratt wrote:
>> pyBZlib
> What is it? Sounds good! Where is it?

pyBZlib is my quick attempt to create a Python interface to the bzip2
compression library after a 'request' on c.l.p yesterday; I must stress that
it is experimental, incomplete and definitely not for the feint hearted yet.

It also has a temporary home for a few days until the server I normally use
is back on line. Until then:

http://yi.com/home/TrattLaurence/pybzlib.tar

will get you the latest version.


Laurie
bzip2 module for Python [ In reply to ]
On Tue, 20 Apr 1999 09:54:49 +0100, Laurence Tratt <tratt@dcs.kcl.ac.uk> wrote:
>In message <87zp43gaac.fsf@illusion.tui-net>
> Paul Kunysch <illume@gmx.net> wrote:
>
>[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.

Hmmm the gzip module could eventually made compatible with
the functionality of the "gzip" GNU programm:
uncompressing .gz .Z (and pack)
compressing .gz

A bzip2 module should be able to do, what the "bzip2" program can do.
But the two modules should work in the same way.

This might be most intuitive for people, I think.

>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? Would you also want it to
>automatically untar files?

untaring (or unzipping multiple files) is a totally different matter.
Someone could argu leaving that to the filesystem, because
that modules would need to act like an filesystem then.

Bernhard
bzip2 module for Python [ In reply to ]
Laurence Tratt <tratt@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