--- id: bazel-runfiles version: "2.3.1" license: unclear license_treatment: permissive maintenance: active --- # bazel-runfiles License: permissive · Maintenance: active · Downloads: 5.1M/mo ## What it is and what it does bazel-runfiles is a lookup library that helps Python code find and access files and binaries that Bazel has packaged as runfiles. When Bazel builds a Python binary or test, it stages dependencies and data files in a runfiles tree; this library provides the API to locate those files at runtime using either a manifest file or a directory structure, depending on the Bazel configuration. The library is designed for use within Bazel-built projects. You create a Runfiles object, then call its Rlocation method with a workspace-qualified path to get the actual filesystem location of a runfile. It also supports setting up environment variables for subprocesses that need to access runfiles themselves. The implementation automatically detects whether to use manifest-based or directory-based lookup based on environment variables set by Bazel. Use it for: - Access data files packaged alongside a Bazel-built Python binary at runtime. - Locate and run other Bazel-built binaries from within a Python test or application. - Set up environment variables for subprocesses spawned by a Bazel-built Python program so they can find their own runfiles. - Resolve workspace-qualified paths to actual filesystem paths in a Bazel build system. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python API to locate and access runfiles (data files and binaries) built and packaged by Bazel, supporting both manifest-based and directory-based lookup strategies. Yes, if you are building Python binaries or tests with Bazel and need to access runfiles at runtime. The package is actively maintained, has no dependencies, and carries a permissive license. It is essential infrastructure for Bazel-Python integration but only relevant within a Bazel project; installing it outside that context is unnecessary. ## Install pip install bazel-runfiles uv add bazel-runfiles poetry add bazel-runfiles ## Installing bazel-runfiles Before you install: Low install friction with no runtime dependencies. Active maintenance as of 2026-08-14 with recent releases. Stable production status. License in practice: Permissive license (Apache Software License) allows use in commercial and proprietary projects without significant restrictions. Quickstart: pip install bazel-runfiles from runfiles import Runfiles r = Runfiles.Create() path = r.Rlocation("my_workspace/path/to/data.txt") with open(path, "r") as f: contents = f.readlines() Requires Python 3.7 or later. Only useful within a Bazel-built project that generates runfiles; requires proper Bazel environment variables to be set. Verify before relying: - Whether the package works correctly outside a Bazel-managed build environment or with older Bazel versions. - Performance characteristics when dealing with large numbers of runfiles or deeply nested directory structures. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bazel runfiles lookup, bazel data file access, bazel binary path resolution, bazel python runfiles, bazel manifest-based file location, bazel, build-system [View on SkillFed](https://skillfed.io/packages/bazel-runfiles) · [View on PyPI](https://pypi.org/project/bazel-runfiles/)