A better Fuse API for Python 3
I don't like Fuse's "high-level" API:
- Having to parse a file's path at every call doesn't make sense except in the context of a "Hello World".
- Related to above, faving to dispatch calls to different files from the same callbacks requires custom "routing" logic, which is meh.
- Threads are cool, but AsyncIO is would be way better ;)
Fuse's The "low-level" API is much more fun, but:
- The callbacks-based API is nice, but require extra work on non-trivial (slow) calls.
- It also requires custom "routing" logic to make the same callbacks reach the correct file handlers.
- You have to manually keep track of inodes and etc
- It is, after all, too low-level for pratical purposes.
Fusetree tries to solve these by providing an object-oriented implementation based on asyncio.
-
Each inode is an instance of
Node
. Inode numbers are tracked automatically and don't require any attention from the programmer.- There is basically 1:1 mapping from fuse methods to
Node
methods, you can override whatever makes sense. - There are reasonable base classes for files, directories and symlinks.
- There are various implementations for several common node types: Constant blob, dict-backed directory, files that perform an HTTP download, etc.
- There is basically 1:1 mapping from fuse methods to
-
Automatic convertions that do the right thing:
str
/bytes
automatically becomes a read-only filedict
become a folderiterable
becomes a non-seekable read-only file
Please take a look at examples