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 developed and maintained by:

The following people contributed to fs.archive:

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

Uploaded Source

Built Distribution

fs.archive-0.7.3-py2.py3-none-any.whl (32.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: fs.archive-0.7.3.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for fs.archive-0.7.3.tar.gz
Algorithm Hash digest
SHA256 102ed42d4e7f40d8053b085e6f1eb9153db6754adea08c44cb1c6e930c95bd92
MD5 68a17c56e42e9246c0f9d3ab60c92dfe
BLAKE2b-256 503bef1f746aff54acdd190cbfa40921bfb59aa510597f0dcd6ff0705da00a15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fs.archive-0.7.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for fs.archive-0.7.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a9826f9d4aec176558677552e022625266f5c372dfd6135fa786d2ed3e714ef3
MD5 3694bf0a5324bbad0a8f684a9e0acef4
BLAKE2b-256 5c30e805da1468195a0d50121d1ff2735a87e6192c1f70869ceead21a86b37e7

See more details on using hashes here.

Supported by

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