rootutils
Simple package for easy project root setup
Decision gist · record as of 2026-08-14
Yes. Rootutils is a lightweight, actively maintained utility that solves a genuine pain point in Python development. Low install friction, permissive license, no known vulnerabilities, and a straightforward API make it a safe choice for projects that need reliable project-root discovery and path configuration.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7.0 or later; python-dotenv must be installed as a runtime dependency.
- Low friction: pure Python wheel with a single runtime dependency (python-dotenv).
- Maintenance is active with recent commits and a modest but steady user base.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2023-05-19 (1183 days) · last repo commit 2026-06-23 · 180 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 222,453 downloads/mo, #9,264 on PyPI
Alternatives
Verify before relying
import rootutils
root = rootutils.setup_root(__file__, dotenv=True, pythonpath=True, cwd=False)
# Now import modules relative to root and access files via root / "path"- Whether the package correctly handles edge cases (symlinks, monorepos, nested .git directories).
- Performance impact of recursive directory searches in large project hierarchies.
- Compatibility with virtual environments and containerized workflows.
What it is and what it does
Rootutils solves a common Python development friction point: ensuring that imports, file paths, and environment variables work consistently regardless of where a script is executed from. It searches up the directory tree for a marker file (like .git, setup.py, or .project-root) to identify your project root, then configures Python's path, working directory, and environment in a single call. The package wraps python-dotenv to load .env files automatically.
The typical workflow is a one-liner at the top of your script or notebook: `rootutils.setup_root(__file__, dotenv=True, pythonpath=True)`. This is especially useful in notebooks nested in subdirectories, where relative imports and file access would otherwise require fragile path manipulation. The package is small, actively maintained, and requires only Python 3.7+.
Use it for
- Set up Jupyter notebooks in nested directories so they can import modules and access data relative to project root.
- Run Python scripts from any working directory without hardcoding absolute paths or managing PYTHONPATH manually.
- Load environment variables from .env automatically without explicit dotenv.load_dotenv() calls.
- Standardize file access across a project by always resolving paths relative to a marker file like .git.
- Configure CI/CD pipelines to run tests consistently regardless of the runner's working directory.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Rootutils is a lightweight, actively maintained utility that solves a genuine pain point in Python development. Low install friction, permissive license, no known vulnerabilities, and a straightforward API make it a safe choice for projects that need reliable project-root discovery and path configuration.
Install
rootutils on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (python-dotenv). Maintenance is active with recent commits and a modest but steady user base.
Requires Python 3.7.0 or later; python-dotenv must be installed as a runtime dependency.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import rootutils
root = rootutils.setup_root(__file__, dotenv=True, pythonpath=True, cwd=False)
# Now import modules relative to root and access files via root / "path"
Verify before relying
- Whether the package correctly handles edge cases (symlinks, monorepos, nested .git directories).
- Performance impact of recursive directory searches in large project hierarchies.
- Compatibility with virtual environments and containerized workflows.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepython-dotenv |
| Maintenance | Actively maintained 1,183 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 222,453 / month, #9,264 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: rootutils-1.0.7-py3-none-any.whl
Tags
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 › “working directory management”
- rootutilsFinds your project root directory and configures Python path, working…
- pyrootutilsFinds your project root directory and configures Python paths,…
- azure-graphrbacManages Azure Active Directory graph resources (users, groups,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
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.
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.
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.
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.
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.
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.
See also pyrootutils · rootpath · pytest-pythonpath · dotenv · pyprojroot · load-dotenv · django-dotenv · xdg-base-dirs · acres · python-dotenv