Oh, this looks really nice. Thank you for posting it! A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it. Basically, the idea is that this: foo = rootfs['home']['amyjess']['stuff']['foo.txt'] rootfs['home']['amyjess']['stuff']['bar.txt'] = bar would be equivalent to this: with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file: foo…
Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
11–20 of 22 posts
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#12Oh, this looks really nice. Thank you for posting it! A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it. Basically, the idea is that this: foo = rootfs['home']['amyjess']['stuff']['foo.txt'] rootfs['home']['amyjess']['stuff']['bar.txt'] = bar would be equivalent to this: with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file: foo…
It basically mounts a dict on a filesystem, the exact opposite of what you want :)
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#13Oh, this looks really nice. Thank you for posting it! A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it. Basically, the idea is that this: foo = rootfs['home']['amyjess']['stuff']['foo.txt'] rootfs['home']['amyjess']['stuff']['bar.txt'] = bar would be equivalent to this: with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file: foo…
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#14Oh, this looks really nice. Thank you for posting it! A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it. Basically, the idea is that this: foo = rootfs['home']['amyjess']['stuff']['foo.txt'] rootfs['home']['amyjess']['stuff']['bar.txt'] = bar would be equivalent to this: with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file: foo…
I once made something like this to mount json files as a fuse filesystem. It's not maintained and one of my first projects, so the code is somewhat questionable, but it does work. It basically mounts a dict on a filesystem, the exact opposite of what you want :) https://github.com/yhekma/datamounter
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#15Oh, this looks really nice. Thank you for posting it! A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it. Basically, the idea is that this: foo = rootfs['home']['amyjess']['stuff']['foo.txt'] rootfs['home']['amyjess']['stuff']['bar.txt'] = bar would be equivalent to this: with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file: foo…
This would insert "bar/baz.txt" from filesystem "foo" in to a template:
${.fs.foo.bar.baz.txt}Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#16Earlier quoted context omitted.
> pyfilesystem is great! Cheers. > My only suggestion would be to improve the search optimization for pypi. Fair point. Not entirely sure how to fix that. I'll look in to it...
PKG-INFO, line 2: Name: fs Looks like it's also registered in PyPI as "fs", from the URL: https://pypi.python.org/pypi/fs/
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#17Earlier quoted context omitted.
PKG-INFO, line 2: Name: fs Looks like it's also registered in PyPI as "fs", from the URL: https://pypi.python.org/pypi/fs/
Maybe have a proxy https://pypi.python.org/pypi/pyfilesystem that has `fs` as a requirement? That way even if people install with `pip install pyfilesystem`, you're good.
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#18Earlier quoted context omitted.
Maybe have a proxy https://pypi.python.org/pypi/pyfilesystem that has `fs` as a requirement? That way even if people install with `pip install pyfilesystem`, you're good.
Hmm. That's an idea. Feels like a hack though. Do you know if there is a precedence for that?
Re: Show HN: PyFilesystem 2.0 – A Python interface to filesystems of all kinds
#19Earlier quoted context omitted.
I once made something like this to mount json files as a fuse filesystem. It's not maintained and one of my first projects, so the code is somewhat questionable, but it does work. It basically mounts a dict on a filesystem, the exact opposite of what you want :) https://github.com/yhekma/datamounter
My big question is why? you wanted to navigate or display a JSON dataset using filesystem-viewer tools? i.e. "Explore" the JSON dataset?
The ansible setup module returns the system information in json, and if you mount it with the --realtime flag, when you open a "file" like ram for instance, ansible fetches the current value for you. That way you have your infrastructure mounted so to speak. Sort of a /proc filesystem for your linux infrastructure.
I never got further than a working poc though. It works, but there are some bugs and there is no regard for security.