skillfed

fs

Python's filesystem abstraction layer

fs v2.4.16 3.8M downloads/30d#2,491 on PyPI2,105
Permissive license MIT AGING released

What it is and what it does

PyFilesystem2 is a filesystem abstraction layer that treats entire filesystems the way Python's file objects treat individual files. Instead of writing code that works only with the OS filesystem using os.walk and open, you write code against an FS object that can transparently work with local directories, zip archives, FTP servers, or other storage backends without any changes to your logic.

The package provides a consistent API across all backends—you open an FS object with a URI-like string (e.g., 'zip://archive.zip' or 'ftp://server/path'), then use methods like walk.files(), open(), and listdir() the same way regardless of where the files actually live. This decouples your application code from storage implementation details and makes it easy to swap backends or test with mock filesystems.

Use it for:

  • Write file-processing code once and run it against local directories, zip files, or remote FTP servers without rewriting the logic.
  • Build tools that need to work with multiple storage backends (e.g., a deployment tool that can read from local, S3, or SFTP).
  • Simplify testing by using in-memory or temporary filesystems instead of touching disk during unit tests.
  • Recursively walk and process files across different storage types using a single walk API.
  • Create filesystem-agnostic libraries or plugins that users can point at any backend they support.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a unified filesystem abstraction layer that lets you work with local directories, zip files, FTP servers, and other storage backends through a single consistent API.

Yes, if you need to write storage-agnostic code or work with multiple filesystem backends. The API is well-established and the package is stable (Production/Stable classifier). However, note that maintenance is aging—the last release was 2022-05-02—so if you rely on active development or rapid bug fixes, evaluate whether that matters for your use case. No known vulnerabilities.

Install

fs on PyPI

pip

pip install fs

uv

uv add fs

poetry

poetry add fs

Installing fs

Before you install

Low install friction with a pure-Python wheel. Maintenance is aging—last release was 2022-05-02 and the repository has not been updated since 2025-05-17, though it remains unarchived and carries 2105 stars.

License in practice

MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, including in commercial projects.

Quickstart

from fs import open_fs

# Open a local directory
local_fs = open_fs('~/projects')

# Or open a zip file with the same API
zip_fs = open_fs('zip://archive.zip')

# List files
for path in local_fs.walk.files():
    print(path)

Verify before relying

  • Whether the aging maintenance status (last release May 2022) affects stability or compatibility with current Python versions.
  • Whether the six and enum34 backport dependencies are still necessary or if they can be dropped for modern Python targets.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 6 — appdirs, setuptools, six, backports.os, enum34, typing
Maintenance aging — 1,565 days since the last release
Last repo commit
First released
Downloads 3,815,225/month — #2,491 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fs-2.4.16-py2.py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: System :: FilesystemsTyping :: Typed

Tags

filesystem abstraction layerunified file interfacework with zip ftp local filesabstract filesystem apistorage backend abstractionfilesystem-agnostic codevirtual filesystem interface
filesystem-abstractionstorage-agnosticmulti-backend

More Filesystems packages