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.3.1.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fs.archive-0.3.1-py2.py3-none-any.whl (28.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: fs.archive-0.3.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fs.archive-0.3.1.tar.gz
Algorithm Hash digest
SHA256 975d007931e2692c5469531b794c0f287b75b1969c30aac2b18564b140662a59
MD5 da86fe1e3d73e43397a7250d100b434b
BLAKE2b-256 e9e37cde9bc1b148e67dc142b7affdf07b0d4847f48176b7464c9e8648c88722

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fs.archive-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 72b22b13f09e1e2361f26c264060f29785ec1502287ccb3905b2beac6e52dae7
MD5 f3a2f316d1b0dead71fec94d216cc337
BLAKE2b-256 6091b0b9e19f2fb9b846250cb56f96985a3e081f5867f7b02ef4c8f7716cb590

See more details on using hashes here.

Supported by

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