Scientific project path utilities (find, split, symlink, versioning)
Project description
scitex-path
Scientific project path utilities for the SciTeX ecosystem.
Provides file/directory finding, path splitting, symlink management, and version incrementing.
Interfaces: Python ⭐⭐⭐ (primary) · CLI — · MCP — · Skills ⭐⭐ · Hook — · HTTP —
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Scripts hard-code /home/user/proj/... paths -- break the moment someone else runs them |
find_git_root() + get_spath(filename) -- paths auto-resolve to the repo root and the current script's _out/ dir |
| 2 | {script}_out/ convention implemented 33 different ways across the ecosystem -- inconsistent, error-prone |
Canonical helpers -- mk_spath, get_this_path, create_relative_symlink, find_latest standardize the pattern |
Installation
pip install scitex-path
Usage
import scitex_path as sp
# Find files by pattern
matches = sp.find_file("*.csv", root="/data/project")
# Find the nearest git root
git_root = sp.find_git_root()
# Split path into components
parts = sp.split("/home/user/project/data/results.csv")
# Symlink management
sp.symlink("/data/raw", "/project/data/raw")
sp.list_symlinks("/project/data")
sp.fix_broken_symlinks("/project/data")
# Version incrementing
next_ver = sp.increment_version("v1.2.3", part="patch") # "v1.2.4"
latest = sp.find_latest("/results/experiment_v*")
API
| Function | Description |
|---|---|
find_file |
Find files matching a glob pattern |
find_dir |
Find directories matching a glob pattern |
find_git_root |
Locate the nearest .git root |
split |
Split a path into structured components |
symlink |
Create a symlink |
create_relative_symlink |
Create a relative symlink |
list_symlinks |
List symlinks under a directory |
fix_broken_symlinks |
Remove or report broken symlinks |
resolve_symlinks |
Resolve all symlinks to real paths |
increment_version |
Bump a version string |
find_latest |
Find the latest versioned path |
clean |
Clean/normalize a path |
getsize |
Get file/directory size |
get_spath / mk_spath |
Session path helpers |
this_path / get_this_path |
Get the path of the calling script |
License
AGPL-3.0 -- see LICENSE for details.
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
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 scitex_path-0.1.3.tar.gz.
File metadata
- Download URL: scitex_path-0.1.3.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e38650c7694eafdf769b7d2e784b0eaacdd5ac6dc0c2059c5e32b515c67f8e
|
|
| MD5 |
6e4fd92a89169247348014f96f4f45a4
|
|
| BLAKE2b-256 |
3786cd6e0cc6eac428f2ceb3ff0943ad52f9fe311a56c3d357ef409610cc594f
|
Provenance
The following attestation bundles were made for scitex_path-0.1.3.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_path-0.1.3.tar.gz -
Subject digest:
b8e38650c7694eafdf769b7d2e784b0eaacdd5ac6dc0c2059c5e32b515c67f8e - Sigstore transparency entry: 1396649077
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-path@a9469fbc4a373e911b723e5cb77227a425fe721a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a9469fbc4a373e911b723e5cb77227a425fe721a -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_path-0.1.3-py3-none-any.whl.
File metadata
- Download URL: scitex_path-0.1.3-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b62eb89e874f7e17afdff1a628d3a84230ee3fa9ba89a20543ec02f58ee1859f
|
|
| MD5 |
2cc73a8e1d0839f8afae8dd5fdcf16f0
|
|
| BLAKE2b-256 |
e031597d2918745e4850c63f96fa13813eaa17830d04f4a008cd3a4ab5ac652f
|
Provenance
The following attestation bundles were made for scitex_path-0.1.3-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_path-0.1.3-py3-none-any.whl -
Subject digest:
b62eb89e874f7e17afdff1a628d3a84230ee3fa9ba89a20543ec02f58ee1859f - Sigstore transparency entry: 1396649124
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-path@a9469fbc4a373e911b723e5cb77227a425fe721a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a9469fbc4a373e911b723e5cb77227a425fe721a -
Trigger Event:
push
-
Statement type: