DVC HTTP/HTTPS Remote Plugin

2.32.0 · active · verified Sat Apr 11

dvc-http is a plugin for Data Version Control (DVC) that provides support for HTTP and HTTPS remotes, allowing DVC to store and retrieve data from web servers. It leverages the `fsspec` library to provide filesystem-like access over HTTP(S). The current version is 2.32.0, and the project maintains an active release cadence with frequent updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `dvc-http` indirectly via the `fsspec` interface to read a file from an HTTP URL. When `dvc-http` is installed, `fsspec.filesystem('http')` will automatically use its backend to handle HTTP operations. For DVC CLI usage, simply configure an HTTP remote (e.g., `dvc remote add myremote http://example.com/data`).

import fsspec
import os

# dvc-http registers itself with fsspec to handle 'http' and 'https' protocols.
# No direct import from dvc_http is typically needed for basic usage.

try:
    # This will use dvc-http's implementation if installed
    fs = fsspec.filesystem("http")
    # Using a placeholder public URL for demonstration
    file_url = "http://www.textfiles.com/100/abacus.txt"

    print(f"Attempting to read from: {file_url}")
    with fs.open(file_url, "r", encoding="utf-8") as f:
        content = f.read(100) # Read first 100 characters
        print(f"\nSuccessfully read from {file_url}:")
        print("--- Content Snippet ---")
        print(content)
        print("-----------------------")
except Exception as e:
    print(f"\nAn error occurred: {e}")
    print("Ensure dvc-http is installed and the URL is accessible.")

view raw JSON →