SCM wrapper and fsspec filesystem for Git for use in DVC.
- Works with multiple backends:
pygit2
,dulwich
andgitpython
. - Provides fsspec filesystem over Git:
GitFileSystem
.
See fsspec docs for full list of available fs methods.
You can install scmrepo via pip from PyPI:
$ pip install scmrepo
scmrepo provides fsspec based gitfs that provides fs-like API for your git
repositories without having to git checkout
them first. For example:
from scmrepo.fs import GitFileSystem
fs = GitFileSystem("path/to/my/repo", rev="mybranch")
for root, dnames, fnames in fs.walk("path/in/repo"):
for dname in dnames:
print(fs.path.join(root, dname))
for fname in fnames:
print(fs.path.join(root, fname))
Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the Apache 2.0 license, scmrepo is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.