Skip to main content

Yandex Disk remote storage plugin for DVC

Project description

dvc-yadisk

Yandex Disk remote storage plugin for DVC (Data Version Control).

Installation

# Using uv
uv add dvc-yadisk

# Using pip
pip install dvc-yadisk

After installation, enable the plugin:

# Run the enable script to register the plugin with DVC
dvc-yadisk-enable

This creates a sitecustomize.py file in your Python environment that loads the plugin automatically when DVC starts.

Configuration

1. Get Yandex Disk OAuth Token

  1. Go to Yandex OAuth
  2. Create a new application
  3. Add permissions: cloud_api:disk.read, cloud_api:disk.write
  4. Generate a debug token or implement OAuth flow https://oauth.yandex.ru/authorize?response_type=token&client_id=
  5. Copy the token

2. Configure DVC Remote

# Add a Yandex Disk remote
dvc remote add -d myremote yadisk://my-dvc-data

# Set the OAuth token (use --local to avoid committing token to git)
dvc remote modify --local myremote token YOUR_OAUTH_TOKEN

Or use environment variable:

export YADISK_TOKEN=YOUR_OAUTH_TOKEN

3. Use DVC as Normal

# Track data
dvc add data/

# Push to Yandex Disk
dvc push

# Pull from Yandex Disk
dvc pull

Configuration Options

Option Environment Variable Description
token YADISK_TOKEN OAuth access token (required)

Example Usage

from dvc_yadisk import YaDiskFileSystem

# Create filesystem instance
fs = YaDiskFileSystem(token="your_oauth_token")

# List files
files = fs.ls("my-folder")

# Check if file exists
exists = fs.exists("my-folder/data.csv")

# Read file
data = fs.cat_file("my-folder/data.csv")

# Write file
fs.pipe_file("my-folder/output.txt", b"Hello, World!")

Async Usage

import asyncio
from dvc_yadisk import get_async_filesystem

async def main():
    AsyncFS = get_async_filesystem()
    fs = AsyncFS(token="your_oauth_token")

    # List files
    files = await fs.ls("my-folder")

    # Read file
    data = await fs.cat_file("my-folder/data.csv")

asyncio.run(main())

Limitations

  • Maximum file size: 1GB (50GB for Yandex 360 subscribers)
  • Upload URLs are valid for 30 minutes
  • API rate limits apply

Development

# Clone repository
git clone https://github.com/Suro4ek/dvc-yadisk.git
cd dvc-yadisk

# Install with dev dependencies
uv sync --dev

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=dvc_yadisk

# Type checking
uv run mypy src/dvc_yadisk

# Linting
uv run ruff check src/dvc_yadisk

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvc_yadisk-0.1.2.tar.gz (196.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dvc_yadisk-0.1.2-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file dvc_yadisk-0.1.2.tar.gz.

File metadata

  • Download URL: dvc_yadisk-0.1.2.tar.gz
  • Upload date:
  • Size: 196.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvc_yadisk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7dfc946ef507bfa1cdc0ce724d3e43fce9c725e388d9af526b114920fb17ac28
MD5 d8087c0b0101a328fb1a7a84e13e16e3
BLAKE2b-256 eedc74ce980fbfa173fd91ff7e53214c684691571f01d0d0903b85d244b12d61

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvc_yadisk-0.1.2.tar.gz:

Publisher: release.yml on Suro4ek/dvc-yadisk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dvc_yadisk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dvc_yadisk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvc_yadisk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31c5ace6c1845456cc2ddacf9856d7dfe5df30a19d868775b3b4f456e17e36a7
MD5 6b093e6b181969e05162200df14c00c8
BLAKE2b-256 f247569d41afc89c4e914c71bfe719e50c3bd4e3a41abce90e0bc981a675f75b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvc_yadisk-0.1.2-py3-none-any.whl:

Publisher: release.yml on Suro4ek/dvc-yadisk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page