pyprojroot
Project-oriented workflow in Python
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 pyprojrootuv
uv add pyprojrootpoetry
poetry add pyprojrootInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
nbsphinx-linkA Sphinx extension that lets you include…
permissive · top 15,000 on PyPI
ipynbImports Jupyter Notebook (.ipynb) files as…
permissive · top 15,000 on PyPI
xdg-base-dirsProvides functions to retrieve XDG Base…
permissive · top 15,000 on PyPI
ipynbnameReturns the filename or full path of the…
permissive · top 15,000 on PyPI
pyrootutilsFinds your project root directory and…
permissive · top 5,000 on PyPI
rootutilsFinds your project root directory and…
permissive · top 15,000 on PyPI
importnbimportnb lets you import Jupyter notebooks as…
permissive · top 15,000 on PyPI
PyPowerStorePyPowerStore is a Python library for managing…
permissive · top 15,000 on PyPI
locateProvides utilities to locate the current Python…
unclear · top 5,000 on PyPI
testbooktestbook lets you write unit tests for Jupyter…
permissive · top 15,000 on PyPI