fsspec / fsspec/filesystem_spec

Url-level glob?

Open
#756 1 comment 1 reaction 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

Hello,

It might be because of my lack of comprehension of the package but I can not find an easy way to perform a glob directly on an url.

I see that with fsspec.get_fs_token_paths I can direclty get a path expansion for instance:

fsspec.get_fs_token_paths('gs://my-bucket/test/*.json')
>>> (<gcsfs.core.GCSFileSystem at 0x7f65ec653af0>,
     '90ad04da79e6e943b0f4d3dfba-------------33462f993faa9252',
     ['my-bucket/test/001.jsonl', 'my-bucket/test/002.jsonl'])

But then in order to get expanded urls, I need to reattach the protocol (parsing the original url), or detect if it is a local file. All of that is already done somewhere in get_fs_token_paths so I was wondering if there is an elegant way to just obtain directly: ['gs://my-bucket/test/001.jsonl', 'gs://my-bucket/test/002.jsonl']. Ideally in a way that handles absolute and local paths as well

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 reading fsspec.get_fs_token_paths and trace how it expands the example gs://my-bucket/test/*.json pattern. Define how the result should preserve protocols for remote URLs while still handling absolute and local paths, then add coverage for those cases and verify the expanded URLs match the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.