pyfilesystem2
pyfilesystem2 copied to clipboard
Python's Filesystem abstraction layer
I'd wager there's a large number of users of this library who will never use the appdirs-based FS drivers. I feel it would be better served as an optional dependency,...
## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [x] Other ## Checklist -...
It would be very cool to add support for asynchronous operations. Most similar libraries like `smart_open` and even the standard `gcs` and `s3` libraries doesn't support async. The only libraries...
I think `os.expandvars` needs to be called before `abspath` in the opener. Example: ```python from fs import open_fs >>> open_fs("~") OSFS('/Users/tf') >>> open_fs("$HOME") ...[snip]... fs.errors.CreateFailed: root path '/Users/tf/Desktop/Users/tf' does not...
## Type of changes - Other ## Checklist - [x] I've run the latest [black](https://github.com/ambv/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate....
Check out this example: ```python import fs import tempfile import os from fs.osfs import OSFS with tempfile.TemporaryDirectory() as test_dir: with open(os.path.join(test_dir, "1.txt"), "wt") as f: f.write("text") os.mkdir(os.path.join(test_dir, "dir")) with open(os.path.join(test_dir,...
## Type of changes - New feature - Refactoring ## Checklist - [x] I've run the latest [black](https://github.com/ambv/black) with default args on new code. - [ ] I've updated CHANGELOG.md...
I've been using pyfilesystem2 a lot in my API projects, and it has been great. Handles so many cases that are useful. One of the things I have been thinking...
Here's a heavily-simplified example of the API I want to offer my users: ```python def opendir(path: str, fs: Optional[fs.base.FS] = None): fs = fs or fs.osfs.OSFS() for subpath in fs.listdir(path):...
See https://github.com/PyFilesystem/pyfilesystem2/issues/506#issuecomment-990905758