[Feature Request] fsspec/universal_pathlib integration
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the MemFS and AbstractFileSystem integration shown in the issue, then inspect fsspec and universal_pathlib registration APIs. Add coverage based on the provided UPath read/write example, and consider the work done when the relevant morefs filesystem subclasses can be created through UPath and registered with both systems.
Written by the indexing model from the issue text.
Description
As far as I understand it, this package cannot be used with universal pathlib right away, but all the building block are already there. All that's missing is registering the AbstractFileSystem subclasses with fsspec and creating fsspec/universal_pathlib subclasses and registering them with their registry.
This seems simple enough and seems to work in my testing:
from fsspec import AbstractFileSystem
from upath import UPath
from upath.registry import register_implementation
from morefs.memory import MemFS
# local instance for inspectability during testing
mem_fs = MemFS()
class MorefsMemPath(UPath):
@classmethod
def _fs_factory(
cls, urlpath: str, protocol: str, storage_options: dict
) -> AbstractFileSystem:
return mem_fs # this should be MemFS(...)
fsname = "customfs"
register_implementation(fsname, MorefsMemPath)
def test_upath():
testtext = "Hello from MemFS!"
testfile = "/example.txt"
p = UPath(f"{fsname}:///{testfile}")
p.write_text(testtext)
assert testtext == p.read_text()
assert mem_fs.ls("/") == [testfile]
- Dominant language
- Python
- Stars
- 18
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from iterative/morefs
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
All issues in iterative/morefs
Similar issues
-
jira: an unquoted JQL number of more than 4300 digits is a plain-text 500, where real answers 200Openfidelity
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
A JSON chat answer blocks the backend event loop for the whole RAG runPossibly taken @NopeCharon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
The-OpenROAD-Project/ORAssistant#656 ·
Maintainers usually reply within 1 day
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day