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 *
print(ROOT_DIR) # the very upper parant directory of "scripts". you can modify source code from "scripts" to other desired src folder name.
print(NOTEBOOK) # True if upper import statement called within .ipynb file else False
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. - 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.2.tar.gz
(3.1 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.2.tar.gz.
File metadata
- Download URL: waypin-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2239045eee24577d3fe7a879944f5cca2c62c1c18cf03fb813d97c1ab6973365
|
|
| MD5 |
aac7876d22dae64d4247b706b21e2910
|
|
| BLAKE2b-256 |
7d4b7fe23de7bcb4aee1dc40d87586fa7377c7a3b5e36f1e9feb8764833e8109
|
File details
Details for the file waypin-0.1.2-py3-none-any.whl.
File metadata
- Download URL: waypin-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 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 |
1630f4e101eb1b9890cf6dbd32ba54878b57380e162c9b9c04f0c46b5bacc7dc
|
|
| MD5 |
a01be1d8f27fefa74bdc18c0effe7f19
|
|
| BLAKE2b-256 |
53f839a23d68a54fcb52c57924369eb6b91e618e1b4ae7bf1a806341b0464fdd
|