Locate a project root by anchor directory name and optionally patch sys.path.
Project description
waypin
A tiny utility to locate a project root by an anchor directory name (default: scripts) and optionally
patch sys.path so absolute imports like from scripts... work in script/main execution and notebooks.
Install
pip install waypin
Usage
from waypin import reel
ROOT_DIR, is_notebook = reel("scripts")
print(ROOT_DIR, is_notebook)
Behavior
- Searches upward from the executing context (caller
__file__, or notebook path if available) to find a directory namedanchor_dirname. - Returns the parent of that directory as
ROOT_DIR. - Optionally appends
ROOT_DIRtosys.path.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
waypin-0.1.0.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waypin-0.1.0.tar.gz.
File metadata
- Download URL: waypin-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53a9df8e0c9e1bd55b5520f792c38ef930174e60ac7436c34b70bbd6f8844858
|
|
| MD5 |
497c69e4d98d57cf7b043cce64402d41
|
|
| BLAKE2b-256 |
7fafe26faadc5109852a818d768f2cfb835023e3dc3b913f6e9e0e66c22283e6
|
File details
Details for the file waypin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: waypin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04f1cb4526a314e740f9e7d75210a269a1e3d1b5c47a20452e1bcb07e9ea21e4
|
|
| MD5 |
3492eb8e85f12980ed9450282cc89f65
|
|
| BLAKE2b-256 |
2ad566f518c985d6b25994393f8ac6c3cbb5260c3d0e21decf2b8c5b3dcfacac
|