Registry / data / dvc-objects

dvc-objects

JSON →
library5.2.0pypypi✓ verified 28d ago

dvc-objects provides filesystem and object-database level abstractions, serving as a core component for DVC (Data Version Control) and related data management tools. It handles operations like hashing files, managing object storage, and providing an fsspec-compatible interface for various backends. The library is actively maintained with frequent minor releases.

pip install dvc-objects
INSTALL
IMPORT
SIG · DVC-OBJECTS
D
dvc-objects
datapythonv5.2.0
Install
1.9s avg
Import
—
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.2.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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.9s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

hash_file
✓ from dvc_objects.file import hash_file
✗ from dvc_objects.file import hash_file

This quickstart demonstrates how to hash a local file using `dvc_objects.file.hash_file`, a fundamental operation within the library for content-addressable storage.

import os import tempfile from pathlib import Path from dvc_objects.file import hash_file from dvc_objects.hash_info import HashInfo # Create a temporary file for demonstration with tempfile.TemporaryDirectory() as tmpdir: test_file_path = Path(tmpdir) / "my_data.txt" test_file_path.write_text("This is some sample data for hashing.") print(f"Hashing file: {test_file_path}") # Hash the file using the default algorithm (e.g., MD5) hash_info: HashInfo = hash_file(test_file_path) print(f"\nFile path: {test_file_path}") print(f"Hash Type: {hash_info.name}") print(f"Hash Value: {hash_info.value}") # Example: Verify content based on hash if hash_info.name == "md5" and hash_info.value == "2efb72b834458f4a7c1b52b36e355745": print("Hash matches expected value!") else: print("Hash does not match expected value or is not MD5.")
Debug
Known issues
breakingPython 3.8 support was dropped in version 5.1.0. Users on Python 3.8 will need to upgrade their Python interpreter to 3.9 or newer.
fix
Upgrade Python to version 3.9 or higher. For example, use pyenv or update your virtual environment.
affects: >=5.1.0
breakingThe `tqdm` implementation and `TqdmCallback` were removed in version 5.0.0. This significantly changes how progress reporting is handled for file operations, requiring users to implement custom callbacks or rely on upstream DVC progress mechanisms.
fix
Remove direct dependencies on `TqdmCallback`. If custom progress reporting is needed, implement a new callback mechanism based on `dvc-objects`' current callback interfaces, or integrate with DVC's global progress reporting.
affects: >=5.0.0
gotchaThe `fs.info` method gained a `return_exceptions` parameter in version 5.2.0. Its default behavior or implications when `True` might alter how errors are handled when querying file system information.
fix
Review calls to `fs.info` and consider the impact of the `return_exceptions` parameter on error handling logic. Explicitly set it if specific exception handling is required.
affects: >=5.2.0
gotchaStarting from versions 5.1.1 and 5.1.2, `dvc-objects` includes enhanced fallback mechanisms for file linking (e.g., copying if `os.link` is unavailable or if `EAGAIN` errors occur during linking). This can affect performance and disk space usage on certain platforms or under specific conditions.
fix
While generally robust, be aware of these internal fallback strategies, especially when debugging performance or disk usage issues related to file storage. Ensure your environment supports efficient linking if performance is critical.
affects: >=5.1.1
Upgrade
Version history
5.2.0latest on PyPI · released Dec 22, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
dvc-objects — pip install dvc-objects · libregistry