MCPcopy
hub / github.com/treeverse/dvc / get

Function get

dvc/repo/get.py:22–64  ·  view source on GitHub ↗
(
    url,
    path,
    out=None,
    rev=None,
    jobs=None,
    force=False,
    config=None,
    remote=None,
    remote_config=None,
)

Source from the content-addressed store, hash-verified

20
21
22def get(
23 url,
24 path,
25 out=None,
26 rev=None,
27 jobs=None,
28 force=False,
29 config=None,
30 remote=None,
31 remote_config=None,
32):
33 from dvc.config import Config
34 from dvc.dvcfile import is_valid_filename
35 from dvc.repo import Repo
36
37 out = resolve_output(path, out, force=force)
38
39 if is_valid_filename(out):
40 raise GetDVCFileError
41
42 if config and not isinstance(config, dict):
43 config = Config.load_file(config)
44
45 with Repo.open(
46 url=url,
47 rev=rev,
48 subrepos=True,
49 uninitialized=True,
50 config=config,
51 remote=remote,
52 remote_config=remote_config,
53 ) as repo:
54 from dvc.fs import download
55 from dvc.fs.data import DataFileSystem
56
57 fs: Union[DataFileSystem, DVCFileSystem]
58 if os.path.isabs(path):
59 fs = DataFileSystem(index=repo.index.data["local"])
60 fs_path = fs.from_os_path(path)
61 else:
62 fs = repo.dvcfs
63 fs_path = fs.from_os_path(path)
64 download(fs, fs_path, os.path.abspath(out), jobs=jobs)

Callers 1

determine_linecolFunction · 0.50

Calls 8

from_os_pathMethod · 0.95
resolve_outputFunction · 0.90
is_valid_filenameFunction · 0.90
DataFileSystemClass · 0.90
downloadFunction · 0.90
openMethod · 0.80
abspathMethod · 0.80
load_fileMethod · 0.45

Tested by

no test coverage detected