{"library":"pyprojroot","title":"pyprojroot","description":"pyprojroot is a Python library that facilitates project-oriented workflows by helping to find the project's root directory and construct paths relative to it. Inspired by R's `rprojroot` and `here` packages, it uses common project markers like `.git`, `setup.py`, or `requirements.txt` to locate the root. The current version is 0.3.0, and it's maintained with releases addressing improvements and compatibility.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pyprojroot"],"cli":null},"imports":["from pyprojroot.here import here","import pyprojroot\nroot_path = pyprojroot.find_root(pyprojroot.has_dir('.git'))"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pyprojroot.here import here\nfrom pathlib import Path\n\n# Simulate a project structure for demonstration\n# In a real project, you would have a .git or other marker in the root.\n# And your data/notebooks would be actual directories.\n\n# Create a dummy project root indicator (e.g., .git directory)\nproject_root_indicator = Path.cwd() / \".git\"\nproject_root_indicator.mkdir(exist_ok=True)\n\n# Create a dummy data directory and file\ndata_dir = here() / \"data\"\ndata_dir.mkdir(parents=True, exist_ok=True)\ndata_file = data_dir / \"my_data.csv\"\ndata_file.write_text(\"column1,column2\\n1,A\\n2,B\")\n\nprint(f\"Project root (found by pyprojroot): {here()}\")\nprint(f\"Absolute path to my_data.csv: {here('data/my_data.csv')}\")\n\n# Example of reading the data using a common library (e.g., pandas)\ntry:\n    import pandas as pd\n    df = pd.read_csv(here('data/my_data.csv'))\n    print(\"\\nData loaded successfully with pandas:\")\n    print(df)\nexcept ImportError:\n    print(\"\\nInstall pandas (pip install pandas) to run the DataFrame example.\")\n\n# Clean up dummy project indicator and data\nproject_root_indicator.rmdir()\ndata_file.unlink()\ndata_dir.rmdir()\n","lang":"python","description":"This quickstart demonstrates how to use `here()` to find the project root and then construct paths to files or directories relative to it. It assumes a project structure with a root marker (like `.git`) and uses `pathlib.Path` objects for robust path manipulation. The example creates temporary files to be runnable.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"0.3.0","pypi_latest":"0.3.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":0.02,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.02,"mem_mb":1.3,"disk_size":"18.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.01,"mem_mb":1.3,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"20.0M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.2,"disk_size":"11.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.03,"mem_mb":1.2,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.02,"mem_mb":1.2,"disk_size":"11.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.02,"mem_mb":1,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.02,"mem_mb":1.3,"disk_size":"17.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyprojroot","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.01,"mem_mb":1.3,"disk_size":"18M"}]}}