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

Uploaded Source

Built Distribution

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: fs.archive-0.7.2.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/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for fs.archive-0.7.2.tar.gz
Algorithm Hash digest
SHA256 739906b7bda4c085016346a437e2118dfe02cdb7a1d63f20606082abe0a4fa1e
MD5 6b7b05e181ca05b94e01b089ae11225e
BLAKE2b-256 d59590ad2f9b1d7a60c895e2b0c4ce033235e637a1fca34c9f798f3e0eff7a83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fs.archive-0.7.2-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/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for fs.archive-0.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9727ba06f7b5c03ee7ef73bcea32ff4fed19dcbc04db711279f1c807620296e5
MD5 b8c0b1fd0471948bb1bf9b883572e2d5
BLAKE2b-256 b041edbc193f1905d26287ad44b49b79e248640ba849c513c4e5886a83bccbcf

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