12.5. tarfile — Read and write tar archive files

New in version 2.3:

New in version 2.3.

The tarfile module makes it possible to read and write tar archives, including those using gzip or bz2 compression. (.zip files can be read and written using the zipfile module.)

Some facts and figures:

  • reads and writes gzip and bz2 compressed archives.

  • read/write support for the POSIX.1-1988 (ustar) format.

  • read/write support for the GNU tar format including longname and longlink extensions, read-only support for the sparse extension.

  • read/write support for the POSIX.1-2001 (pax) format.

    New in version 2.6:

    New in version 2.6.