Registry / devops / dvc-studio-client

dvc-studio-client

JSON →
library0.23.0pypypi✓ verified 24d ago

dvc-studio-client is a Python library designed to facilitate posting data from DVC (Data Version Control) and DVCLive to Iterative Studio. It provides functionalities for managing the Model Registry, sending Live Experiment updates, and handling Studio authentication. The library is currently at version 0.22.0 and maintains a regular release cadence, with recent updates focused on Python version support and Studio URL alignment.

pip install dvc-studio-client
INSTALL
IMPORT
SIG · DVC-STUDIO-CLIENT
D
dvc-studio-client
devopspythonv0.23.0
Install
2.9s avg
Import
387ms
Disk
27MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.23.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.402s · 27MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.9s · import 0.372s · 30MB
27MB installed
● package 27MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

post_live_metrics
from dvc_studio_client import post_live_metrics
get_access_token
from dvc_studio_client import get_access_token

This quickstart demonstrates how to use `dvc-studio-client` to post live experiment metrics to Iterative Studio. It simulates an experiment run, capturing metrics and parameters, and then uses the `post_live_metrics` function to send this data. Ensure you have a DVC_STUDIO_TOKEN environment variable set or replace the placeholder.

import os from dvc_studio_client import post_live_metrics, get_access_token # A real token would be obtained from Iterative Studio or DVC CLI configuration studio_token = os.environ.get("DVC_STUDIO_TOKEN", "your_studio_token_here") if studio_token == "your_studio_token_here": print("WARNING: DVC_STUDIO_TOKEN not set. Using placeholder.") # Mock metrics and parameters for an experiment metrics_data = { "exp_name": "my-first-studio-experiment", "metrics": {"train/accuracy": 0.88, "val/loss": 0.12}, "params": {"learning_rate": 0.005, "batch_size": 64, "epochs": 10}, "step": 50, "dvc_env": {"dvc_version": "3.0.0"} } try: # Post metrics to Iterative Studio # Replace 'https://github.com/iterative/example-repo.git' with your actual repository URL # Replace 'abcdef0123...' with a real Git commit SHA (e.g., from your baseline experiment) response = post_live_metrics( token=studio_token, repo_url="https://github.com/iterative/example-repo.git", baseline_sha="abcdef0123456789abcdef0123456789abcdef01", **metrics_data ) print(f"Successfully posted metrics. Response: {response.get('url', 'N/A')}") except Exception as e: print(f"Failed to post metrics: {e}") # The get_access_token function is typically used in more interactive/programmatic authentication flows. # For quickstart, we acknowledge its presence. Actual usage might open a browser. # print(f"get_access_token function is available: {get_access_token}")
Debug
Known issues
breakingPython 3.8 support was dropped in version 0.21.0. Users on Python 3.8 or older must upgrade their Python environment to 3.9 or newer to use versions 0.21.0 and later.
fix
Upgrade your Python environment to 3.9 or newer.
affects: >=0.21.0
breakingThe default Studio URL was updated in versions 0.21.0 and 0.22.0. Older client versions might attempt to connect to an outdated domain, leading to connection issues.
fix
Upgrade `dvc-studio-client` to the latest version to ensure it uses the correct Studio endpoint.
affects: >=0.21.0
breakingAuthentication functions were renamed and refactored in versions 0.17.0 and 0.17.1. `initiate_authentication` was renamed to `get_access_token` in 0.17.0, and a broader refactoring from 'Authorization' to 'Authentication' occurred in 0.17.1.
fix
Update calls from `initiate_authentication` to `get_access_token`. Review and adapt any custom authentication logic to the new `Authentication` terminology and structure.
affects: >=0.17.0
gotchaVersion 0.20.0 introduced optional `subdir` information for monorepos within the schema and `post_live_metrics`. If you are operating within a monorepo structure and need to differentiate experiments by subdirectory, you might need to update your data posting logic.
fix
Consider passing the `subdir` argument to `post_live_metrics` if your project utilizes a monorepo structure and requires sub-directory context for experiments in Studio.
affects: >=0.20.0
Errors
Common errors & fixes
Errors occurring with dvc-studio-client when using Python 3.8 or older (e.g., SyntaxError for newer Python features, or general unexpected behavior).
dvc-studio-client dropped support for Python 3.8 in version 0.21.0 and later, making it incompatible with older Python environments.
fix
Upgrade your Python environment to 3.9 or newer.
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)) or requests.exceptions.SSLError: HTTPSConnectionPool(...) when connecting to Iterative Studio.
The default Studio URL was updated in dvc-studio-client versions 0.21.0 and 0.22.0, causing older client versions to attempt connection to an outdated or incorrect domain.
fix
Upgrade `dvc-studio-client` to the latest version to ensure it uses the correct Studio endpoint: `pip install --upgrade dvc-studio-client`.
AttributeError: module 'dvc_studio_client' has no attribute 'initiate_authentication' or similar errors related to 'Authorization' vs 'Authentication'.
Authentication functions were renamed (e.g., `initiate_authentication` to `get_access_token`) and refactored from 'Authorization' to 'Authentication' in dvc-studio-client versions 0.17.0 and 0.17.1.
fix
Update calls from `initiate_authentication` to `get_access_token` and adapt any custom authentication logic to the new `Authentication` terminology and structure.
ModuleNotFoundError: No module named 'dvc_studio_client'
The `dvc-studio-client` library is not installed in the current Python environment or the environment is not activated correctly.
fix
Install the library using pip: `pip install dvc-studio-client`.
Output of `dvc studio login` shows a link to `https://studio.iterative.ai/auth/device-login?code=...` even after `dvc config studio.url <custom_url>` was set.
The `dvc studio login` command might ignore the `studio.url` configuration and default to `studio.iterative.ai`.
fix
Manually navigate to your custom Studio URL with the provided device code, or ensure the `DVC_STUDIO_URL` environment variable is set to your custom Studio instance URL before running the command.
Upgrade
Version history
0.23.0latest on PyPI · released Jun 1, 2026
Audit
Dependencies
dulwichrequiredUsed for Git repository operations.
requestsrequiredHandles HTTP requests to the Studio API.
voluptuousrequiredUsed for data validation.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
dvc-studio-client — pip install dvc-studio-client · libregistry