Skip to main content

Enhanced archive filesystems for Pyfilesystem2

Project description

fs.archive star me

Source PyPI Actions Codecov Codacy License Versions Format GitHub issues Downloads Changelog

Requirements

PyFilesystem2 PyPI fs Source fs License fs
six PyPI six Source six License six

fs.archive supports all Python versions supported by PyFilesystem2: Python 2.7, and Python 3.5 onwards. Code should still be compatible with Python 3.4, but is not tested anymore.

Installation

Install directly from PyPI, using pip:

$ pip install fs.archive

Additional features

fs.archive also provides the following extras, allowing you to read from more archive formats:

  • 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.
  • 7z: support for 7z archives. Requires the py7zr and iocursor libraries.
  • all: install all of the above.

Usage

Opener

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'>

Constructors

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

Feedback

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker of the project if you need to report or ask something. If you are filling in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproductible situation.

Credits

fs.sshfs is developped and maintainted by:

This project obviously owes a lot to the PyFilesystem2 project and all its contributors.

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

Uploaded Source

Built Distribution

fs.archive-0.7.0-py2.py3-none-any.whl (31.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: fs.archive-0.7.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for fs.archive-0.7.0.tar.gz
Algorithm Hash digest
SHA256 dc386059b7633a2054d1114e0283c440fb70e38264a611c1a81eeec7191e4efd
MD5 a662a06890a8ce09bb34904371710981
BLAKE2b-256 4a4d95fd876f7fb032c9d22ca9511a5b0208434d6b2ecd22695ca2e5313847e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fs.archive-0.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for fs.archive-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a3c698067a6be90ef5ae3baffa2533802f1d1ded997c73655b0a612e088fe2e3
MD5 fc3fe0ef417405ffe116a84389d6bf94
BLAKE2b-256 27ee6ae6d1121a90deac7a5efc07a103831ae5a3573b05a96f5fcee4517cbb57

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