$npx skillfedfor your agent

pyrootutils

Simple package for easy project root setup

With conditionsPyPI UtilitiesReleased Jun 20221.4M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pyrootutils-1.0.4-py3-none-any.whl
v1.0.4 · released 2022-06-09 · Python >=3.7.0 · 1 runtime deps: python-dotenv

Yes, if you work with multi-directory Python projects, notebooks, or scripts that need to run from different locations. The single-function setup and low install friction make it a practical utility. The active maintenance and zero known vulnerabilities support confidence in use. The lack of recent releases is not a concern given the package's simplicity and stable scope.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction install with a single runtime dependency (python-dotenv).
  • Maintenance status is active with recent commits, though the package itself has not had a release since 2022-06-09.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions.

last release 2022-06-09 (1527 days) · last repo commit 2026-06-23 · 180 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,361,255 downloads/mo, #4,002 on PyPI

Verify before relying

pip install pyrootutils

import pyrootutils

root = pyrootutils.setup_root(
    search_from=__file__,
    indicator=".project-root",
    dotenv=True,
    pythonpath=True,
    cwd=True
)
  • Whether the package handles symlinks or unusual filesystem layouts reliably
  • Performance characteristics when searching deeply nested directory hierarchies
  • Compatibility with virtual environments and editable installs
Same gist for agents: .md · .json

What it is and what it does

pyrootutils solves the common problem of Python scripts failing or requiring complex relative imports when run from different working directories. It locates your project root by searching for a marker file (like .git, .project-root, or pyproject.toml) and then configures your Python environment in one step: setting PYTHONPATH so imports work relative to the root, changing the working directory, loading .env variables via its python-dotenv dependency, and optionally setting a PROJECT_ROOT environment variable.

The package is designed for developers who want scripts and notebooks to work consistently regardless of where they're executed from. It's particularly useful in projects with nested directories, notebooks in subdirectories, or teams running scripts from different locations. The setup is a single function call, making it lightweight and easy to integrate into existing projects.

Use it for

  • Run Jupyter notebooks from nested subdirectories while importing from the project root
  • Execute scripts from any directory without path-related failures or complex ../../../ imports
  • Automatically load environment variables from .env without manual configuration in each script
  • Set up CI/CD pipelines where scripts may be invoked from varying working directories
  • Simplify data science projects where data paths and module imports need consistent root references

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you work with multi-directory Python projects, notebooks, or scripts that need to run from different locations.

The single-function setup and low install friction make it a practical utility. The active maintenance and zero known vulnerabilities support confidence in use. The lack of recent releases is not a concern given the package's simplicity and stable scope.

Install

pyrootutils on PyPI

Before you install

Low friction install with a single runtime dependency (python-dotenv). Maintenance status is active with recent commits, though the package itself has not had a release since 2022-06-09.

License in practice

MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install pyrootutils

import pyrootutils

root = pyrootutils.setup_root(
    search_from=__file__,
    indicator=".project-root",
    dotenv=True,
    pythonpath=True,
    cwd=True
)

Verify before relying

  • Whether the package handles symlinks or unusual filesystem layouts reliably
  • Performance characteristics when searching deeply nested directory hierarchies
  • Compatibility with virtual environments and editable installs

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.7.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
python-dotenv
MaintenanceActively maintained 1,527 days since the last release
Last repo commit
First released
Downloads1,361,255 / month, #4,002 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: pyrootutils-1.0.4-py3-none-any.whl

Tags

Capabilities
project root finderpythonpath setupworking directory managementrelative imports from project rootdotenv loaderscript path resolutioncross-directory script execution
Topics
project-setuppath-management

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “project root finder”

  • pyrootutilsFinds your project root directory and configures Python paths,…
  • rootutilsFinds your project root directory and configures Python path, working…
  • pyprojrootFinds your project's root directory and provides a `here()` function…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also rootutils · rootpath · pytest-pythonpath · pyprojroot · xdg-base-dirs · platformdirs · dotenv · python-discovery · django-dotenv