Skip to main content

MagicFS (mafs)

MagicFS is an easy-to-use library that allows anyone to easily create virtual filesystems using FUSE.

MagicFS allows you to redirect file requests, so instead of the request going to an underlying storage medium like a hard drive, the request goes to a program that you've written.

If you like the idea of playing around with virtual filesystems, but have been put off by the complexity of it all, then this library could be for you. You can easily create whole, feature-complete filesystems in just a few lines of code. No need for painstakingly dealing with folder structures and buffers, mafs manages all the low-level details, provides sane defaults, and lets you focus on the functionality.

Installation

MagicFS is available on pypi, and can be easily installed with pip.

$ pip3 install mafs

Examples

All of the examples are listed in examples/. Here's a demo of running the places.py example.

$ mkdir fs
$ python3 examples/places.py fs
$ ls fs
place  shortcut
$ ls fs/place
here  there
$ cat fs/place/here
this is here
$ cat fs/place/there
this is there
$ cat fs/place/anywhere
this is anywhere!
$ fusermount -u fs

Development

To download MagicFS for development, execute the following commands:

$ git clone https://github.com/jedevc/mafs.git
$ cd mafs
$ pip3 install -r requirements.txt

To launch mafs with an example, execute the following:

$ PYTHONPATH=. python3 examples/places.py fs -fg

Note the use of the PYTHONPATH environment variable to include the library, and the use of the -fg flag to run mafs in the foreground for easier debugging.

Tests

To run the tests for MagicFS, install nose, and then use it to run the tests.

$ pip install nose
$ nosetests

If you make any changes, please run the tests before you commit to ensure that you haven't broken anything.

Metadata

Release files for mafs 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mafs 0.2.1
File Size Uploaded
mafs-0.2.1.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mafs 0.2.1
File Interpreter ABI Platform
mafs-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / mafs-0.2.1.tar.gz

Download URL mafs-0.2.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
be52e8fcdb88a325fc915b88e23a495d4799dbc8d02788b44bdec751c0ddcdd9
BLAKE2b-256 checksum
How to use checksums
3970fb0ce76421f2d9729f89d4dbd37f72768c414532900a22ea017fb20c99b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / mafs-0.2.1-py3-none-any.whl

Download URL mafs-0.2.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbfd379ab1f8522d5bd81bcbea6a3295ea74ed61925596dfb5b9e05b0f09aaf6
BLAKE2b-256 checksum
How to use checksums
971dc7df872b4af6691eb674810039ebd94df0cca4f5d7cf94df9aff6d26d788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2

2 release files

0.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page