XZ - 03 Mac OS

Today's release of Python 3.3 includes the lzma module in the standard library for LZMA/XZ files, but it didn't work 'out of the box' under Mac OS X 10.8 Mountain Lion - it requires XZ Utils. This is how I installed it.
  1. Xz - 03 Mac Os Catalina
  2. Xz - 03 Mac Os X
  3. Xz - 03 Mac Os Operating System
  4. Xz - 03 Mac Os Release

The XZ format is a single-file compression format and does not offer archiving capabilities. Based on the LZMA2 algorithm, the XZ format offers lossless compression which means it preserves the original data with no loss in quality, making it ideal for distributing things like software applications. Jun 23, 2017 Install xz on Mac OSX. June 23, 2017 Amber. App name: xz; App description: General-purpose data compression with high compression ratio. XZ Utils is free general-purpose data compression software with a high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils. The core of the XZ Utils compression code is based on LZMA SDK, but it has been modified quite a lot to be suitable for XZ. From the command line, I would like to compress some database dumps using the LZMA algorithm. And, OSX adds XZ support (written in October of last year), claims' It turns out the XZ support in OS X 10.10 is kind of broken.Singleā€file XZ file streams like those created by XZ Utils, 7zip, and other popular compression utilities are entirely unsupported.

At the time of writing Python 3.3 doesn't come pre-compiled for Mac OS X 10.8 Mountain Lion (only older versions of OS X), so I built it from source (having installed XCode via the App Store for free). However, I had a warning about _lzma not being built, and the associated test_lzma.py was skipped.
You have to install the XZ Utils library as well, I opted to do this under my home directory:
$ curl -O http://tukaani.org/xz/xz-5.0.4.tar.gz
$ tar -zxvf xz-5.0.4.tar.gz
$ cd xz-5.0.4
$ ./configure --prefix=$HOME
$ make
$ make check
$ make install
Easy enough, and now (re)install Python 3.3 which I am also installing under my home directory:

Xz - 03 Mac Os Catalina


$ curl -O http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz
$ tar -zxvf Python-3.3.0.tgz
$ cd Python-3.3.0
$ ./configure --prefix=$HOME
$ make
$ make test
$ make install
Done. Time for a quick check:
$ python3
Python 3.3.0 (default, Sep 29 2012, 19:41:44)
Mac[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import lzma
>>> dir(lzma)
['CHECK_CRC32', 'CHECK_CRC64', 'CHECK_ID_MAX', 'CHECK_NONE', 'CHECK_SHA256', 'CHECK_UNKNOWN', 'FILTER_ARM', 'FILTER_ARMTHUMB', 'FILTER_DELTA', 'FILTER_IA64', 'FILTER_LZMA1', 'FILTER_LZMA2', 'FILTER_POWERPC', 'FILTER_SPARC', 'FILTER_X86', 'FORMAT_ALONE', 'FORMAT_AUTO', 'FORMAT_RAW', 'FORMAT_XZ', 'LZMACompressor', 'LZMADecompressor', 'LZMAError', 'LZMAFile', 'MF_BT2', 'MF_BT3', 'MF_BT4', 'MF_HC3', 'MF_HC4', 'MODE_FAST', 'MODE_NORMAL', 'PRESET_DEFAULT', 'PRESET_EXTREME', '_BUFFER_SIZE', '_MODE_CLOSED', '_MODE_READ', '_MODE_READ_EOF', '_MODE_WRITE', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__initializing__', '__loader__', '__name__', '__package__', '_decode_filter_properties', '_encode_filter_properties', 'builtins', 'compress', 'decompress', 'io', 'is_check_supported', 'open']
>>> quit()
Next will be to explore if this is actually useful for things like compressed sequence files.
Note for older versions of Python (which don't come with the lzma module), you can install PylibLZMA instead (PylibLZMA SourceForge page), which requires LZMA Utils (although I haven't tried that yet - my first attempt failed at the compile stage). Update - could perhaps try PyLZMA too (PyLZMA GitHub page)? Note these don't seem to support the XZ format.
Update
I've started a backport of Python 3.3's lzma module, currently working on Python 3.1, 3.2 and 3.3 (Mac OS X and Linux), so that I can use both LZMA and XZ files on older versions of Python.
Update
Fixed XY <-> XZ typos.

Xz - 03 Mac Os X


Update (Jan 2013)

Xz - 03 Mac Os Operating System


I've just made the first public release of my lzma backport on PyPI, tested under Python 2.6, 2.7 and 3.0 to 3.3 on Mac OS X and Linux. Windows support is pending...

Xz - 03 Mac Os Release

Xz - 03 mac os catalina