Skip to main content

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

scitex_path-0.1.2.tar.gz (46.5 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.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file scitex_path-0.1.2.tar.gz.

File metadata

  • Download URL: scitex_path-0.1.2.tar.gz
  • Upload date:
  • Size: 46.5 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.2.tar.gz
Algorithm Hash digest
SHA256 e3e75790f83d72d925029156de537436039ab0e48b396f48194972e1bc0057b9
MD5 a4370a4718f2b6efde402f7e0ca7b5a2
BLAKE2b-256 a157e5045a84eb0f346b66d841e8688f21e02538bd262302d2807b1809efc558

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_path-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: scitex_path-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 29.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6080756cfe88937d5ce6cc6b5e5dd8089cd05fcc4c99331a1f935c3616b9109
MD5 5a74dc26240499eab73850bdfeaf26e5
BLAKE2b-256 1df716ff7da3c16001d832963a4322651a4597324426d10ad3b21d63445415cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_path-0.1.2-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