Skip to main content

Enhanced archive filesystems for Pyfilesystem2

Project description

Source PyPI Travis Codecov Codacy Format License

Requirements

pyfilesystem2

PyPI fs

Source fs

License fs

six

PyPI six

Source six

License six

Installation

Install directly from PyPI, using pip

pip install fs.archive

Additional features

fs.archive also provides the following extras:

all

install all the extras listed below.

tar.xz

support for xz compressed tar files. Requires the additional backports.lzma module in Python 2, but is available natively in Python 3.

iso

pure-python reading/writing ISO disk images (with support for ISO 9660 Levels 1, 2 and 3, Joliet and Rock Ridge extensions). Requires the pycdlib library.

Usage

The fs.archive.open_archive function is the easiest way to open an archive filesystem, with an archive located on any other filesystem, directly determining the class to use from the file extension:

>>> from fs import open_fs
>>> from fs.archive import open_archive

>>> my_fs = open_fs(u'temp://')
>>> with open_archive(my_fs, u'test.zip') as archive:
...     type(archive)
<class 'fs.archive.zipfs.ZipFS'>

All the filesystems implemented in fs.archive also support reading from — and if not read-only, writing to — a file handle:

>>> import fs.archive.tarfs
>>> with fs.open_fs(u'mem://') as mem:
...     with fs.archive.tarfs.TarFS(mem.openbin(u'test.tar', 'w')) as tar:
...         tar.setbytes(u'hello', b'Hello, World!')
...     with fs.archive.tarfs.TarFS(mem.openbin(u'test.tar', 'r+')) as tar:
...         tar.isfile(u'hello')
True

See also

  • fs, the core pyfilesystem2 library

  • fs.sshfs, a SFTP/SSH implementation for pyfilesystem2 using paramiko

  • fs.smbfs, a SMB implementation for pyfilesystem2 using pysmb

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fs.archive-0.5.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

fs.archive-0.5.0-py2.py3-none-any.whl (25.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file fs.archive-0.5.0.tar.gz.

File metadata

  • Download URL: fs.archive-0.5.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for fs.archive-0.5.0.tar.gz
Algorithm Hash digest
SHA256 63ebdaf94f1a44fdf3b7a57c94dafc6b78563c48ba2ef7bb85ea7eee6057f8b4
MD5 97b2ab8b287d092a6d2878620f8fd296
BLAKE2b-256 1d2fcaa8a00cad0eae6e36b2ac1915f822d255fb752eec8b15573dd4a6f7ae7f

See more details on using hashes here.

File details

Details for the file fs.archive-0.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: fs.archive-0.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for fs.archive-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f5180f007fab0cf6789978a8140e988ba3911be4667b6138a6ee166ac09fe735
MD5 b1d22dae5996593f4b9d0d9cb188b4de
BLAKE2b-256 72bbefdea7de7b748b691818180cfb1506d8a5f38ba8acaf04f2095d4d079777

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page