skillfed

mfusepy

Ctypes bindings for the high-level API in libfuse 2 and 3

mfusepy v3.1.1 120.5K downloads/30d#12,020 on PyPI41
Permissive license ISC Active released

What it is and what it does

mfusepy is a ctypes-based Python wrapper around libfuse that lets you implement custom filesystems in pure Python. Instead of writing C code, you subclass the Operations class and implement methods like getattr, read, write, and readdir to define how your filesystem behaves. The kernel then mounts your Python filesystem as a regular volume that applications can interact with transparently.

This is a maintained fork of the long-unmaintained fusepy project, adding support for both libfuse 2 and libfuse 3 and addressing performance bottlenecks in the original. It runs on Linux, macOS, FreeBSD, NetBSD, and OpenBSD. The package has no Python dependencies—it relies only on ctypes and the system libfuse library—making installation straightforward once you have the underlying fuse library installed.

Use it for:

  • Build a loopback filesystem that presents existing files with custom metadata or access control.
  • Create an in-memory filesystem for temporary data that persists only during the session.
  • Mount remote storage as a local filesystem without implementing a full driver.
  • Implement a read-only archive filesystem that extracts and serves files on demand.
  • Prototype filesystem semantics or test application behavior against custom filesystem behavior.

Worth the install?

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

mfusepy provides Python bindings to libfuse 2 and 3, enabling you to create custom filesystems in userspace that the kernel exposes as mountable volumes.

Yes. mfusepy is actively maintained, has no Python dependencies, supports both libfuse 2 and 3 across multiple Unix-like platforms, and carries no known vulnerabilities. Install it if you need to build a custom filesystem in Python and have libfuse available on your system. The ISC license is permissive. The main gotcha is the system-level fuse dependency, not the package itself.

Install

mfusepy on PyPI

pip

pip install mfusepy

uv

uv add mfusepy

poetry

poetry add mfusepy

Installing mfusepy

Before you install

Low friction install with no runtime dependencies. The package is actively maintained (last commit 2026-08-10) and has been in active development since its initial release. You must separately install the fuse or fuse3 system package.

License in practice

ISC is a permissive license with minimal restrictions, allowing commercial and private use with only attribution required. No significant constraints for most use cases.

Quickstart

pip install mfusepy

import mfusepy

class MyFilesystem(mfusepy.Operations):
    def getattr(self, path, fh=None):
        pass

fs = MyFilesystem()
mfusepy.FUSE(fs, '/mnt/point', foreground=True)

Requires libfuse 2.6+ or later installed on your system (fuse or fuse3 package); Python 3.9 or later.

Verify before relying

  • Whether the performance improvements mentioned (ctypes struct exposure) are measurable in typical workloads.
  • Compatibility matrix across all supported platforms for libfuse 2 vs. 3.
  • Whether the two bugfixes from the original fork have been fully validated in production use.

Package facts

License ISC (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 154 days since the last release
Last repo commit
First released
Downloads 120,549/month — #12,020 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mfusepy-3.1.1-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: MacOSOperating System :: POSIXOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: BSD :: OpenBSDOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: System :: Filesystems

Tags

fuse python bindingscreate custom filesystem pythonuserspace filesystem librarylibfuse ctypes wrappermount virtual filesystem pythonfuse high-level api pythonfilesystem abstraction layer
filesystem-abstractionctypes-bindingsunix-systems

More Filesystems packages