Skip to main content

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

Project description

mfusepy

Python Version PyPI version Downloads Changelog License Build Status Discord Telegram

mfusepy is a Python module that provides a simple interface to FUSE and macFUSE. It's just one file and is implemented using ctypes to use libfuse.

Installation

Via PyPI:

pip install mfusepy

You also need to install the fuse (2) or fuse3 package on your system.

Versioning

This version tries to follow Semantic Versioning. If you depend on this project, you should fix the major version, or else you risk your project breaking on a newer version release! E.g., in your pyproject.toml:

dependencies = ["mfusepy ~= 1.1",]

If you have tested with multiple major versions and they are known to work, you can relax the constraint for maximum compatibility:

dependencies = ["mfusepy >= 1.1, < 3.0",]

About this fork

This is a fork of fusepy because it did not see any development for over 6 years. Refuse was an attempt to fork fusepy, but it has not seen any development for over 4 years. Among many metadata changes, it contains two bugfixes to the high-level API, which I have redone in this fork. See also the discussion in this issue. I intend to maintain this fork as long as I maintain ratarmount, which is now over 5 years old.

The main motivations for the fork are:

  • FUSE 3 support. Based on the libfuse changelog, the amount of breaking changes should be fairly small. It should be possible to simply update these ten or so changed structs and functions in the existing fusepy.
  • Translation layer performance. In benchmarks for a simple find call that lists all files, some callbacks such as readdir turned out to be significantly limited by converting Python dictionaries to ctype structs. The idea would be to expose the ctype structs to the fusepy caller.
    • Much of the performance was lost trying to populate the stat struct even though only the mode and inode member are used by the kernel FUSE API.

The prefix m in the name stands for anything you want it to: "multi" because multiple libfuse versions are supported, "modded", "modern", or "Maximilian".

Comparison with other libraries

High-level interface support (path-based)

Project License Dependants Notes
fusepy ISC 63 The most popular Python-bindings, but unfortunately unmaintained for 6+ years.
python-fuse LGPL 12 Written directly in C interfacing with fuse.h and exposing it via Python.h. Only supports libfuse2, not libfuse3.
refuse ISC 3 Dead fork of fusepy with many other dead forks: [1] [2]
fusepyng ISC 0 Dead fork of fusepy. GitHub repo has been force-pushed as a statement. Fork here.
userspacefs GPL3 (why not ISC?) 1 Fork of fusepyng/fusepy. Gated behind a self-hosted solution with no possibility to open issues or pull requests.
fusepy3 ISC Not on PyPI Fork of fusepy for the fox-it/dissect ecosystem to add libfuse3 support. Seems to drop libfuse2 support and does not appear to work around the ABI incompatibilities between libfuse3 minor versions. Last updated 1.5 years ago. Looks like publish-and-forget, or it may simply have no bugs.

Low-level interface support (inode/int-based)

All these libraries only wrap the low-level libfuse interface, which works with inodes instead of paths, and therefore are not (easily) usable for my use case. In the end, there is mostly only some path-to-hash table in the high-level libfuse API, but it is cumbersome to implement and performance-critical.

Project License Dependants Notes
pyfuse3 LGPL 9 ReadMe contains: "Warning - no longer developed!".
llfuse LGPL 2 ReadMe contains: "Warning - no longer developed!".
arvados-llfuse LGPL 1 Fork of llfuse, but less up to date?
aliyundrive-fuse MIT 0 Alibaba Cloud Disk FUSE disk mounting. "This repository has been archived by the owner on Mar 28, 2023". Documentation is only in Chinese. Read-only support. Multiple fizzled-out forks: pikpak-fuse, alist-fuse

Examples

See some examples of how you can use mfusepy:

Example Description
memory A simple memory filesystem
loopback A loopback filesystem
context Sample usage of fuse_get_context()
sftp A simple SFTP filesystem (requires paramiko)

Platforms

mfusepy requires FUSE 2.6 (or later) and runs on:

  • Linux (i386, x86_64, PPC, arm64, MIPS)
  • macOS (Apple Silicon, Intel)
  • FreeBSD (i386, amd64)
  • NetBSD (amd64)
  • OpenBSD (amd64)

While FUSE is (at least in the Unix world) a Linux kernel feature, several user space libraries exist for easy access. libfuse acts as the reference implementation.

Known Dependents

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

mfusepy-3.1.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mfusepy-3.1.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file mfusepy-3.1.0.tar.gz.

File metadata

  • Download URL: mfusepy-3.1.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mfusepy-3.1.0.tar.gz
Algorithm Hash digest
SHA256 33b5e13d1595c7acf0171fb30faaf1ce47df484457352b1d379a9e2b39ac3d3f
MD5 8ca5dc0545ba467aaf368163b51b2526
BLAKE2b-256 cbbfc976a2ac998e7c2f777f7c0682163c17573c1a68f099bf58d21a370150e7

See more details on using hashes here.

File details

Details for the file mfusepy-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: mfusepy-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mfusepy-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e96affd78ca38aef70846bd115aa6ad1ee7a11de5c7e71abeb29e8f4caab0f32
MD5 fabd79f3b5cef7c6aa4b8afb303edecb
BLAKE2b-256 a20284d6e4607d27cddef9bc18defe42b9df720a2f7c1eb8a815ad81bad9d4fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page