scitex-path
Scientific project path utilities — find files / git root, symlink mgmt, version increment.
Full Documentation · uv pip install scitex-path[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Hard-coded paths — scripts break on other machines. | Auto-resolve — find_git_root plus get_spath fixes locations. |
| 2 | Scattered outputs — every script invents its own out-dir. | Canonical helpers — mk_spath and friends standardize layout. |
Quick Start
import scitex_path as sp
git_root = sp.find_git_root()
matches = sp.find_file("/data/project", "*.csv")
Demo
%%{init: {'flowchart': {'nodeSpacing': 20, 'rankSpacing': 40, 'curve': 'linear'}, 'themeVariables': {'fontSize': '12px'}}}%%
flowchart LR
A[script.py] -->|find_git_root| B[repo root]
A -->|mk_spath| C[script_out/]
C --> D[results.csv]
D -->|create_relative_symlink| E[repo/latest.csv]
F[/runs/experiment_v*/] -->|find_latest| G[experiment_v17.txt]
Figure 1. Path resolution flow from calling script to versioned outputs.
import scitex_path as sp
root = sp.find_git_root() # → /home/me/proj/myrepo
out = sp.mk_spath("results.csv") # → <script>_out/results.csv
sp.create_relative_symlink(out, root / "latest.csv")
print(sp.find_latest("/runs", "experiment", ".txt")) # → /runs/experiment_v17.txt
/home/me/proj/myrepo
/home/me/proj/myrepo/scripts/train_out/results.csv
/runs/experiment_v17.txt
Installation
uv pip install "scitex-path[all]"
Per-module extras
| Extra | Pulls in |
|---|---|
dev |
pytest, pytest-cov, scitex-dev |
docs |
Sphinx plus theme and myst-parser |
all |
dev plus docs (recommended) |
uv pip install "scitex-path[dev]" # contributors
uv pip install -e ".[dev]" # editable install
Architecture
1. Find and resolve
find_file, find_dir, and find_git_root locate files and the repo root without hard-coded paths.
2. Session outputs
mk_spath, get_spath, and this_path anchor outputs to the calling script's _out directory.
3. Links and versions
symlink helpers manage links while increment_version and find_latest handle versioned runs.
%%{init: {'flowchart': {'nodeSpacing': 20, 'rankSpacing': 40, 'curve': 'linear'}, 'themeVariables': {'fontSize': '12px'}}}%%
flowchart LR
FIND[find module] --> RESOLVE[this_path and spath]
RESOLVE --> LINK[symlink module]
RESOLVE --> VERSION[version module]
LINK --> OUT[stable paths]
VERSION --> OUT
Figure 2. Module collaboration from discovery to stable versioned paths.
1 Interfaces
Python API
import scitex_path as sp
# Find
sp.find_file("/data/project", "*.csv")
sp.find_dir("/runs", "results_*")
sp.find_git_root()
# Path manipulation
sp.split("/home/user/project/data/results.csv")
sp.clean("path/with/../spaces ")
sp.getsize("/path/to/dir")
# Symlinks
sp.symlink("/data/raw", "/project/data/raw")
sp.create_relative_symlink(src, dst)
sp.list_symlinks("/project/data")
sp.fix_broken_symlinks("/project/data")
sp.resolve_symlinks(path)
# Versioning
sp.increment_version("/runs", "experiment", ".txt") # → /runs/experiment_v001.txt
sp.find_latest("/runs", "experiment", ".txt") # → /runs/experiment_v003.txt
# Session paths (relative to calling script)
sp.this_path() / sp.get_this_path()
sp.get_spath(filename) / sp.mk_spath(filename)
Part of SciTeX
scitex-path is part of SciTeX. Install via
the umbrella with pip install scitex[path] to use as
scitex.path (Python) or scitex path ... (CLI).
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
License
AGPL-3.0 — see LICENSE for details.
Metadata
Release files for scitex-path 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scitex_path-0.1.9.tar.gz | 8.6 MB | Without provenance | Details for scitex_path-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scitex_path-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for scitex_path-0.1.9-py3-none-any.whl |
Total release size: 16.9 MB
Release files / scitex_path-0.1.9.tar.gz
| Download URL | scitex_path-0.1.9.tar.gz |
|---|---|
| Size | 8.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b2d8fd65d947b988f0ebb95361d46dc4c3b7c7a3ac7fb4122b4468f154cab84
|
|
BLAKE2b-256 checksum How to use checksums |
e778a0fe0325df8cd845a680980b9c9e0c892af0c15e3e8ed1efdc8a8e27cc22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / scitex_path-0.1.9-py3-none-any.whl
| Download URL | scitex_path-0.1.9-py3-none-any.whl |
|---|---|
| Size | 8.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f87a5365467740248a107c93877444f0626e92f98974c357b406b36c6b11f3cf
|
|
BLAKE2b-256 checksum How to use checksums |
02f2c01306f5fd9f6f1d3365afa945b44575fff63b20a1ca1d2cf498e9c83196
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for scitex-path 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.