skillfed

pyprojroot

Project-oriented workflow in Python

pyprojroot v0.3.0 348.4K downloads/30d#7,340 on PyPI166
Permissive license Abandoned released

What it is and what it does

pyprojroot solves the working-directory problem in data science and research workflows: when you run scripts from different directories or use Jupyter notebooks (which change the working directory to the notebook's location), relative file paths break. This package finds your project root by looking for markers like .git, .here, or pyproject.toml, then provides a `here()` function that returns a pathlib.Path object for any file relative to that root. You call `here('data/myfile.csv')` instead of `../data/myfile.csv`, and the path stays valid no matter where you run the code from.

The package has two interfaces: an interactive `here()` function (inspired by the R `here` package) for quick use in notebooks, and a programmatic `find_root()` API (inspired by R's `rprojroot`) for more control over how the root is detected. It depends only on typing-extensions and installs with minimal friction. However, the project is abandoned—last updated in March 2023—so it receives no new features or maintenance, though the core functionality is stable.

Use it for:

  • Access data files in Jupyter notebooks without rewriting paths when you move notebooks between folders.
  • Write scripts that work correctly whether called from the project root or from a subdirectory.
  • Build reproducible workflows where file paths are absolute from project root, not relative to script location.
  • Manage projects with nested folder structures (data/, notebooks/, src/) without hardcoding relative paths.
  • Avoid path-related bugs when refactoring project structure—only data location changes require path updates.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Finds your project's root directory and provides a `here()` function to construct file paths relative to that root, regardless of your current working directory.

Yes, if you work in data science or research with Jupyter notebooks and project-oriented workflows. The package is small, stable, and solves a real pain point. However, the abandoned maintenance status means you should treat it as a utility you own—no updates will arrive if Python or your environment changes significantly. For new projects, verify that the root-detection markers (like .git) align with your project structure.

Install

pyprojroot on PyPI

pip

pip install pyprojroot

uv

uv add pyprojroot

poetry

poetry add pyprojroot

Installing pyprojroot

Before you install

Low friction install with a single runtime dependency (typing-extensions). Maintenance is abandoned—last release was 2023-03-13, over 1250 days ago—so expect no bug fixes or updates, though the package is stable for its narrow scope.

License in practice

MIT license (permissive) means you can use this freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pyprojroot

from pyprojroot.here import here

path = here('data/myfile.csv')

Requires Python 3.7 or later. Project root detection relies on finding markers like .git, .here, or pyproject.toml in a parent directory.

Verify before relying

  • Whether the package correctly detects project roots in monorepo or nested project structures.
  • Performance impact when called repeatedly in tight loops or on deeply nested directory trees.
  • Compatibility with modern Python versions (3.11+) given the abandoned maintenance status.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing-extensions
Maintenance abandoned — 1,250 days since the last release
Last repo commit
First released
Downloads 348,381/month — #7,340 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyprojroot-0.3.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

project root directory finderrelative paths from project rootjupyter notebook working directoryhere function pythonproject-oriented workflowdata folder path resolutioncross-directory file access
data-sciencejupyter-friendlypath-resolution

More Utilities packages