Dvc: api: get_url() returns path to `.dir` for directory

Created on 17 Jan 2020  路  3Comments  路  Source: iterative/dvc

Currently, get_url() returns path to .dir files. I'd propose to have some way to parse get_url() and return list or dicts (or, iterator) of files inside the directory (get_url(recurse=True)?).

dvc get . dir/ --show-url works the same way.

feature request p2-medium

Most helpful comment

I am not a big fan of complicating .get_url(), this was always intended for files not dirs. Maybe we should not support .get_url() for dirs at all? What's the use case anyway?

All 3 comments

I am not a big fan of complicating .get_url(), this was always intended for files not dirs. Maybe we should not support .get_url() for dirs at all? What's the use case anyway?

Note: as we've discussed in #2994 , get_url might not even be able to access the cache url that it shows, so we won't always be able to parse .dir 馃檨 User of get_url might download .dir himself and parse it as a workaround.

I would wait for requests from users before going forward with this.

I'm adding some notes about .dir cache files as a preamble to document this in the api docs as well. See f4900e8..7d1b469 (part of #931).

UPDATE: OK, added to API as well (24f2d67a, part of iterative/dvc.org/pull/908).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danfischetti picture danfischetti  路  41Comments

dmpetrov picture dmpetrov  路  35Comments

Casyfill picture Casyfill  路  56Comments

gvyshnya picture gvyshnya  路  36Comments

JoeyCarson picture JoeyCarson  路  53Comments