Skip to main content

Scientific project path utilities (find, split, symlink, versioning)

Project description

scitex-path

PyPI Python Tests Install Test Coverage Docs License: AGPL v3

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

scitex_path-0.1.3.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_path-0.1.3-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

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

Hashes for scitex_path-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b8e38650c7694eafdf769b7d2e784b0eaacdd5ac6dc0c2059c5e32b515c67f8e
MD5 6e4fd92a89169247348014f96f4f45a4
BLAKE2b-256 3786cd6e0cc6eac428f2ceb3ff0943ad52f9fe311a56c3d357ef409610cc594f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_path-0.1.3.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-path

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for scitex_path-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b62eb89e874f7e17afdff1a628d3a84230ee3fa9ba89a20543ec02f58ee1859f
MD5 2cc73a8e1d0839f8afae8dd5fdcf16f0
BLAKE2b-256 e031597d2918745e4850c63f96fa13813eaa17830d04f4a008cd3a4ab5ac652f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page