TreeFuse creates a FUSE filesystem from a treelib.Tree
Project description
TreeFuse
TreeFuse is a library for building FUSE filesystem CLIs from treelib Tree objects.
It wraps python-fuse to provide a CLI entrypoint (treefuse_main) which takes a tree parameter and uses that to construct a directory tree and generate file content within the FUSE filesystem.
Example Program
Executing this program:
tree = treelib.Tree() root = tree.create_node("root") dir1 = tree.create_node("dir1", parent=root) tree.create_node("dirchild", parent=dir1, data=b"dirchild content\n") tree.create_node("rootchild", parent=root, data=b"rootchild content\n") treefuse_main(tree)
With a target directory (e.g. python3 example.py mnt) will mount a filesystem matching the given tree:
$ tree mnt mnt ├── dir1 │ └── dirchild └── rootchild 1 directory, 2 files $ cat mnt/rootchild rootchild content $ cat mnt/dir1/dirchild dirchild content
Free software: GNU General Public License v3
Documentation: https://treefuse.readthedocs.io.
Roadmap
For 1.0
For a first, minimal, feature complete release, we need:
All XXX comments have been addressed
Library consumers can provide stat values for files and directories
Usable documentation
Beyond
Abstract the interface so that sources other than treelib can be implemented
Provide a mechanism for library consumers to populate filesystem contents asynchronously
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
This library was written during a hack week at my employer, DigitalOcean.
History
0.1.0 (2021-07-27)
First release on PyPI.
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
Built Distribution
Hashes for treefuse-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f388d8b3bbf52e1c90a54082458d14caac857bb70fadea8510867ec70c297f |
|
MD5 | 01d68d90735aefbe944db9e6948d2eb3 |
|
BLAKE2b-256 | 7be6fd3830ff82dc8da5b9525bf2ea2ce3a76d137f7d148be33a421ca44784e5 |