fsspec / fsspec/filesystem_spec

Bring some utility functions to `fsspec.FUNC`

Open
#478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

There are plenty of small utility functions that could be applied from a URI without having to instantiate a filespec object. It makes life much easier when you want to deal with different types of filesystem transparently.

Here are two examples:

def is_valid_file(path):
    """Check whether a file is a valid path"""
    mapper = fsspec.get_mapper(path)
    return mapper.fs.isfile(path)


def is_local_path(path):
    """Check whether a path point to a local filesystem."""
    mapper = fsspec.get_mapper(path)
    return mapper.fs.protocol == "file"

I guess the idea is similar to what fsspec.open already provides.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing fsspec.open entry point and how the URI examples obtain filesystem objects through fsspec.get_mapper. Define which utility functions belong in fsspec.FUNC and how they should work across filesystem types; done means the requested URI-based utilities are available without instantiating a filesystem object.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.