{"id":20483449,"url":"https://github.com/styczynski/dvc-fs","last_synced_at":"2026-07-15T00:35:46.446Z","repository":{"id":79817374,"uuid":"367726597","full_name":"styczynski/dvc-fs","owner":"styczynski","description":"High-level API work easy writing/reading/listing files inside the DVC","archived":false,"fork":false,"pushed_at":"2023-03-27T11:47:25.000Z","size":490,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T08:40:03.053Z","etag":null,"topics":["dvc","fs","pyfilesystem2","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styczynski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-15T20:45:29.000Z","updated_at":"2023-03-04T07:45:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"741140e6-87ed-418a-94e9-86b0251a7543","html_url":"https://github.com/styczynski/dvc-fs","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/styczynski/dvc-fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Fdvc-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Fdvc-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Fdvc-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Fdvc-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styczynski","download_url":"https://codeload.github.com/styczynski/dvc-fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Fdvc-fs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35485403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dvc","fs","pyfilesystem2","python","python3"],"created_at":"2024-11-15T16:17:24.023Z","updated_at":"2026-07-15T00:35:46.441Z","avatar_url":"https://github.com/styczynski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DVC filesystem abstraction layer (0.8.3)\n\n[![PyPI version](https://badge.fury.io/py/dvc-fs.svg)](https://badge.fury.io/py/dvc-fs) [![Build and test](https://github.com/styczynski/dvc-fs/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/styczynski/dvc-fs/actions/workflows/build_and_test.yml) [![Lint code](https://github.com/styczynski/dvc-fs/actions/workflows/lint.yml/badge.svg)](https://github.com/styczynski/dvc-fs/actions/workflows/lint.yml)\n\nThis package was developed by [@styczynski](https://github.com/styczynski/).\nGreat thanks to [@hasanozdem1r](https://github.com/hasanozdem1r) who contributed a lot to this project!**\n\nThis package provides high-level API work easy writing/reading/listing files inside the DVC.\nIt can be used for automation systems integrated with data pipelines.\n\ndvc-fs provides basic compatibility (Still work in progress) with [PyFilesystem2 API](https://github.com/PyFilesystem/pyfilesystem2).\n\n## :floppy_disk: Installation\n\nTo install this package please do:\n```bash\n  $ python3 -m pip install \"dvc-fs==0.8.3\"\n```\nOr with Poetry:\n```bash\n  $ poetry install dvc-fs\n```\n\n### :question: Usage\n\n**Using via PyFielsystem2:**\n\nThe dvc-fs package is integrated with [PyFilesystem](https://github.com/PyFilesystem/pyfilesystem2), so you can do:\n\n```python\nfrom fs import open_fs\nfs1 = open_fs(\"dvc://github.com/deepflare/data-artifacts\") # Clone by https\nfs2 = open_fs(\"dvc://ssh@github.com/deepflare/data-artifacts\") # Clone by ssh\nfs3 = open_fs(\"dvc://\u003cPAT\u003e@github.com/deepflare/data-artifacts\") # Clone by https with personal access token\n # You can also use normal HTTPS and create env variable GIT_TOKEN\n # In that case Personal Access Token will be injected in the clone url\n```\n\nAnd now the usage is as follows:\n```python\nfrom fs import open_fs\nwith open_fs(\"dvc://github.com/deepflare/data-artifacts\") as fs:\n    fs.writetext(\"fs_test/fasta2.txt\", \"TEST\")\n```\n\n**Explicitly creating DVCFS:**\n\nThis method allows you to explicitly create DVCFS class in your applciation:\n\n```python\nfrom dvc_fs.fs import DVCFS\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    for path in fs.walk.files():\n        # Print all paths in repo\n        print(path)\n```\n\n## Basic features\n\n**List all files with walk():**\n\n```python\nfrom dvc_fs.fs import DVCFS\n\nwith DVCFS(\n    \"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\"\n) as fs:\n    for path in fs.walk.files():\n        print(path)\n```\n\n**Check if the file exists:**\n\n```python\nfrom dvc_fs.fs import DVCFS\nfrom os import environ\n\nwith DVCFS(\n    dvc_repo=f\"https://{environ['GIT_TOKEN']}@github.com/deepflare/data-artifacts.git\"\n) as fs:\n    for path in [\"cirk//BVic HIs_SH2021.xlsx\"]:\n         print(fs.exists(path=path))\n```\n\n**Removing files:**\n\n```python\nfrom dvc_fs.fs import DVCFS\n\nwith DVCFS(\n    \"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/data-artifacts.git\"\n) as fs:\n    fs.writetext(\"data/to_remove.txt\", \"TEST STRING ABCDEF 123456\")\n    fs.remove(\"data/to_remove.txt\")\n```\n\n## Writing to the repository from various sources\n\nRead and write contents:\n```python\nfrom dvc_fs.fs import DVCFS\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    contents = fs.readtext('data/1.txt')\n    print(f\"THIS IS CONTENTS: {contents}\")\n    fs.writetext(\"test.txt\", contents+\"!\")\n```\n\nYou can also directly use DVC high-level api via the Client:\n```python\nfrom dvc_fs.client import Client, DVCPathUpload\n\n# Git repo with DVC configured\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    fs.bulk_update([\n        # Upload local file ~/local_file_path.txt to DVC repo under path data/1.txt\n        DVCPathUpload(\"data/1.txt\", \"~/local_file_path.txt\"),\n    ])\n```\n\nThe upload operator supports various types of data inputs that you can feed into it.\n\n**Uploading a string as a file:**\n```python\nfrom dvc_fs import DVCStringUpload, DVCPathUpload\nfrom datetime import datetime\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    fs.bulk_update([\n        DVCStringUpload(\"data/1.txt\", f\"This will be saved into DVC. Current time: {datetime.now()}\"),\n    ])\n```\n\n**Uploading local file using its path:**\n```python\nfrom dvc_fs import DVCPathUpload\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    fs.bulk_update([\n        DVCPathUpload(\"data/1.txt\", \"~/local_file_path.txt\"),\n    ])\n```\n\n**Upload content generated by a python function:**\n```python\nfrom dvc_fs import DVCCallbackUpload\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    fs.bulk_update([\n        DVCCallbackUpload(\"data/1.txt\", lambda: \"Test data\"),\n    ])\n```\n\nWe can use `download` operation similarily to the `upload`. The syntax is the same:\n```python\nfrom dvc_fs import DVCCallbackDownload\n\n# Download DVC file data/1.txt and print it on the screen\nwith DVCFS(\"https://\u003cGITHUB_PERSONAL_TOKEN\u003e@github.com/deepflare/dvc_repo.git\") as fs:\n    fs.bulk_update([\n        DVCCallbackDownload(\"data/1.txt\", lambda content: print(content)),\n    ])\n```\n\n### Versioning\n\nTo bump project version before release please use the following command (for developers):\n```bash\n    $ poetry run bump2version minor\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyczynski%2Fdvc-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyczynski%2Fdvc-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyczynski%2Fdvc-fs/lists"}