{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/4"}],"enrichment":{"capability":"Provides utilities to locate the current Python file's directory and modify sys.path relative to that location for importing from nearby modules.","skillfed_tags":["import-management","path-utilities"],"use_cases":["Load custom modules stored in a sibling directory without modifying PYTHONPATH or installing them as packages","Write scripts that work identically whether run from the command line, Jupyter notebook, or interactive shell","Temporarily import from a local directory within a specific code block using a context manager"],"what_it_does":"Locate is a small utility library that solves the problem of finding the directory of the currently running Python script and dynamically modifying the import search path relative to that location. It provides three main functions: `this_dir()` returns the directory of the executing script (or the current working directory in interactive sessions), while `append_sys_path()` and `prepend_sys_path()` allow you to add directories relative to the script location to Python's import path, either permanently or temporarily via context manager. The context manager implementation uses a tagged string subclass to safely track and remove insertions, so nested context managers won't corrupt the restoration.\n\nThe package targets developers who organize their projects with custom modules stored alongside scripts and want those imports to work consistently whether the script runs directly, from a notebook, or from a REPL. It's inspired by Julia's approach to directory resolution. Since the package has no runtime dependencies and installs as a pure Python wheel, it has minimal friction\u2014but it has been abandoned since mid-2023, so no further updates or fixes should be expected.","worth_installing":"Yes, if you need a lightweight way to locate your script and manage relative imports without external dependencies. No, if you require ongoing maintenance or active support\u2014the package is abandoned and will not receive updates. The unclear license is a secondary concern but worth clarifying before use in proprietary code."},"id":"locate","links":{"html":"https://skillfed.io/packages/locate","md":"https://skillfed.io/packages/locate.md","pypi":"https://pypi.org/project/locate/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-12-15","license_spdx":null,"license_treatment":"unclear","name":"locate","python_support":"supports_current","summary":"Locate the file location of your current running script."},"popularity":{"monthly_downloads":2257106,"position":3184,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.1.1"}
