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.4.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.4-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_path-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ad5fc36f08c6733930ea7ecdd4c77938cae82388cc6e2233aa1ee8050de6098b
MD5 364d7b9c7556bf11a209fc7f5625d3a7
BLAKE2b-256 242b8fd84f0884a97588158a6f739efcd3346d220f1af405a93b03c90f81df41

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: scitex_path-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 29.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a83bf17621ffb3f135a4feeab561aa17cba6ffd13ccccf4110015f5cbafb9739
MD5 6fae1c24094db9b67a7e0a41b771d68f
BLAKE2b-256 9020dc0997174c7e3f8c8b9e9f408fcab26b6953551b6850238877a8dd5b4633

See more details on using hashes here.

Provenance

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