| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="module-zipfile.html" /> |
| 13 | <link rel="prev" href="module-gzip.html" /> |
| 14 | <link rel="parent" href="someos.html" /> |
| 15 | <link rel="next" href="node406.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>7.17 bz2 -- Compression compatible with bzip2</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="7.16 gzip " |
| 25 | href="module-gzip.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="7. Optional Operating System" |
| 28 | href="someos.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="7.17.1 (De)compression of files" |
| 31 | href="node406.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Python Library Reference</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="module-gzip.html">7.16 gzip </A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="someos.html">7. Optional Operating System</A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="node406.html">7.17.1 (De)compression of files</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H1><A NAME="SECTION0091700000000000000000"> |
| 56 | 7.17 <tt class="module">bz2</tt> -- |
| 57 | Compression compatible with <b class="program">bzip2</b></A> |
| 58 | </H1> |
| 59 | |
| 60 | <P> |
| 61 | <A NAME="module-bz2"></A> |
| 62 | |
| 63 | <P> |
| 64 | |
| 65 | <span class="versionnote">New in version 2.3.</span> |
| 66 | |
| 67 | <P> |
| 68 | This module provides a comprehensive interface for the bz2 compression library. |
| 69 | It implements a complete file interface, one-shot (de)compression functions, |
| 70 | and types for sequential (de)compression. |
| 71 | |
| 72 | <P> |
| 73 | Here is a resume of the features offered by the bz2 module: |
| 74 | |
| 75 | <P> |
| 76 | |
| 77 | <UL> |
| 78 | <LI><tt class="class">BZ2File</tt> class implements a complete file interface, including |
| 79 | <tt class="method">readline()</tt>, <tt class="method">readlines()</tt>, |
| 80 | <tt class="method">writelines()</tt>, <tt class="method">seek()</tt>, etc; |
| 81 | </LI> |
| 82 | <LI><tt class="class">BZ2File</tt> class implements emulated <tt class="method">seek()</tt> support; |
| 83 | </LI> |
| 84 | <LI><tt class="class">BZ2File</tt> class implements universal newline support; |
| 85 | </LI> |
| 86 | <LI><tt class="class">BZ2File</tt> class offers an optimized line iteration using |
| 87 | the readahead algorithm borrowed from file objects; |
| 88 | </LI> |
| 89 | <LI>Sequential (de)compression supported by <tt class="class">BZ2Compressor</tt> and |
| 90 | <tt class="class">BZ2Decompressor</tt> classes; |
| 91 | </LI> |
| 92 | <LI>One-shot (de)compression supported by <tt class="function">compress()</tt> and |
| 93 | <tt class="function">decompress()</tt> functions; |
| 94 | </LI> |
| 95 | <LI>Thread safety uses individual locking mechanism; |
| 96 | </LI> |
| 97 | <LI>Complete inline documentation; |
| 98 | </LI> |
| 99 | </UL> |
| 100 | |
| 101 | <P> |
| 102 | |
| 103 | <p><br /></p><hr class='online-navigation' /> |
| 104 | <div class='online-navigation'> |
| 105 | <!--Table of Child-Links--> |
| 106 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 107 | |
| 108 | <UL CLASS="ChildLinks"> |
| 109 | <LI><A href="node406.html">7.17.1 (De)compression of files</a> |
| 110 | <LI><A href="node407.html">7.17.2 Sequential (de)compression</a> |
| 111 | <LI><A href="node408.html">7.17.3 One-shot (de)compression</a> |
| 112 | </ul> |
| 113 | <!--End of Table of Child-Links--> |
| 114 | </div> |
| 115 | |
| 116 | <DIV CLASS="navigation"> |
| 117 | <div class='online-navigation'> |
| 118 | <p></p><hr /> |
| 119 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 120 | <tr> |
| 121 | <td class='online-navigation'><a rel="prev" title="7.16 gzip " |
| 122 | href="module-gzip.html"><img src='../icons/previous.png' |
| 123 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 124 | <td class='online-navigation'><a rel="parent" title="7. Optional Operating System" |
| 125 | href="someos.html"><img src='../icons/up.png' |
| 126 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 127 | <td class='online-navigation'><a rel="next" title="7.17.1 (De)compression of files" |
| 128 | href="node406.html"><img src='../icons/next.png' |
| 129 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 130 | <td align="center" width="100%">Python Library Reference</td> |
| 131 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 132 | href="contents.html"><img src='../icons/contents.png' |
| 133 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 134 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 135 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 136 | <td class='online-navigation'><a rel="index" title="Index" |
| 137 | href="genindex.html"><img src='../icons/index.png' |
| 138 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 139 | </tr></table> |
| 140 | <div class='online-navigation'> |
| 141 | <b class="navlabel">Previous:</b> |
| 142 | <a class="sectref" rel="prev" href="module-gzip.html">7.16 gzip </A> |
| 143 | <b class="navlabel">Up:</b> |
| 144 | <a class="sectref" rel="parent" href="someos.html">7. Optional Operating System</A> |
| 145 | <b class="navlabel">Next:</b> |
| 146 | <a class="sectref" rel="next" href="node406.html">7.17.1 (De)compression of files</A> |
| 147 | </div> |
| 148 | </div> |
| 149 | <hr /> |
| 150 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 151 | </DIV> |
| 152 | <!--End of Navigation Panel--> |
| 153 | <ADDRESS> |
| 154 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 155 | </ADDRESS> |
| 156 | </BODY> |
| 157 | </HTML> |