Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Miscellaneous proxy filesystems for Pyfilesystem2

Project description

Source PyPI Travis Codecov Codacy Format License


pyfilesystem2 PyPI fs Source fs License fs
six PyPI six Source six License six
psutil PyPI psutil Source psutil License psutil


Install directly from PyPI, using pip

pip install fs.proxy


This module revolves around the notion of proxy filesystems, akin to wrapper filesystems from the core library, but using a proxy in combination with the delegate filesystem used by WrapFS. They also make it easier to create generic wrappers, as fs.proxy.base.Proxy subclasses will use the fs.base.FS method implementation, while actually deriving from WrapFS !

This extension includes a base fs.proxy.base.Proxy class, that requires only the essential filesystem methods to be implemented.

The fs.proxy.writer package also declares two classes that can be used to make any read-only filesystem writeable, using a secondary writeable filesystem: fs.proxy.writer.ProxyWriter and fs.proxy.writer.SwapWriter. ProxyWriter will always write modifications to the secondary filesystem (often a MemoryFS or a TempFS), while SwapWriter will use a third backup filesystem in case the memory footprint of the proxy filesystem becomes too large (swapping from a MemoryFS to an OSFS, etc.). For instance, let’s pretend we can write to the root:

>>> import fs.proxy.writer

>>> read_only_fs = fs.open_fs(u'/') # this is not actually read-only ;)
>>> writeable_fs = fs.proxy.writer.ProxyWriter(read_only_fs)
>>> writeable_fs.setbytes(u'/root.txt', b'I am writing in root !')

>>> writeable_fs.exists(u'/root.txt')
>>> read_only_fs.exists(u'/root.txt')

See also

  • fs, the core pyfilesystem2 library
  • fs.archive, enhanced archive filesystems for pyfilesystem2
  • fs.sshfs, a SFTP/SSH implementation for pyfilesystem2 using paramiko
  • fs.smbfs, Pyfilesystem2 over SMB 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.

Files for fs.proxy, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size fs.proxy-0.1.4-py2.py3-none-any.whl (10.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size fs.proxy-0.1.4.tar.gz (7.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page