mfusepy
Ctypes bindings for the high-level API in libfuse 2 and 3
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 mfusepyuv
uv add mfusepypoetry
poetry add mfusepyInstalling 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
Tags
More Filesystems packages
Watches file system changes and triggers…
permissive · top 1,000 on PyPI
watchdogWatchdog monitors file system events across…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
filetypeInfers file type and MIME type by examining…
permissive · top 1,000 on PyPI
pathvalidateSanitize and validate filenames and file paths…
permissive · top 5,000 on PyPI
pathlibProvides object-oriented filesystem path…
permissive · top 5,000 on PyPI
fusepyfusepy provides Python bindings to FUSE…
permissive · top 15,000 on PyPI
pyobjc-framework-NetFSProvides Python bindings to macOS's NetFS…
permissive · top 15,000 on PyPI
pyobjc-framework-KernelManagementProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
pyfakefspyfakefs mocks the Python file system modules…
permissive · top 5,000 on PyPI
fsspecfsspec provides a unified filesystem interface…
unclear · top 100 on PyPI
morefsmorefs provides fsspec-based filesystem…
permissive · top 15,000 on PyPI
ftputilftputil provides a high-level FTP client…
permissive · top 15,000 on PyPI
pyobjc-framework-FSKitProvides Python bindings to macOS's FSKit…
permissive · top 15,000 on PyPI
dissect.volumeParses disk volume and partition systems…
agpl · top 15,000 on PyPI
fsProvides a unified filesystem abstraction layer…
permissive · top 5,000 on PyPI