Host check + safe file mv — standalone module from the SciTeX ecosystem
Project description
scitex-os
Host check + safe file move helpers — zero-dep, pure stdlib.
Full Documentation · uv pip install scitex-os[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Host-specific scripts use socket.gethostname() == 'X' -- different style across every repo; no consistent error message when the check fails |
scitex_os.check_host / is_host / verify_host -- single canonical helper triple; check_host and is_host return bool, verify_host calls sys.exit(1) on mismatch |
| 2 | os.rename(src, dst) breaks across filesystems -- "Invalid cross-device link" when the target is on a different mount |
scitex_os.mv(src, dst) -- atomic when same filesystem, copy+unlink fallback otherwise; auto-creates parent dir |
Installation
pip install scitex-os
Quick Start
import scitex_os as sxos
if sxos.is_host("compute-01"):
sxos.mv(src, tgt)
1 Interfaces
Python API
import scitex_os as sxos
sxos.is_host("hostname") # bool
sxos.check_host("hostname") # bool
sxos.verify_host("hostname") # sys.exit(1) on mismatch
sxos.mv(src, tgt) # shutil.move with mkdir(tgt)
Status
Standalone fork of scitex.os. Pure stdlib — zero deps. The umbrella package's
scitex.os import path is preserved via a sys.modules-alias bridge.
Architecture
scitex_os/
├── _check_host.py ← is_host / check_host / verify_host
├── _mv.py ← `mv` (shutil.move + mkdir(target.parent))
└── __init__.py ← public surface (zero deps beyond stdlib)
Demo
flowchart LR
A[script.py] -->|is_host| B{hostname<br/>matches?}
B -- yes --> C[sxos.mv src → tgt<br/>auto mkdir parent]
B -- no --> D[skip / raise]
import scitex_os as sxos
if sxos.is_host("compute-01"):
sxos.mv("results/run.csv", "/shared/runs/2026-05-07/run.csv")
# parent dir is auto-created; cross-filesystem moves are handled.
$ python -c "import scitex_os; print(scitex_os.is_host('laptop'))"
True
Part of SciTeX
scitex-os is part of SciTeX. Install via
the umbrella with pip install scitex[os] to use as
scitex.os (Python) or scitex os ... (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-only (see LICENSE).
Project details
Release history Release notifications | RSS feed
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_os-0.1.8.tar.gz.
File metadata
- Download URL: scitex_os-0.1.8.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c83076d075e9fbcd032273f8da0ebcbcaa3f4d3adc287ecb25ec53777081fcd7
|
|
| MD5 |
45a19b78daba3aa72565ef16dbfe99a1
|
|
| BLAKE2b-256 |
fbfd01ed691ef80d0b918844fa3e4e3814dc1fa36f5b45012223dc82e40a42a8
|
Provenance
The following attestation bundles were made for scitex_os-0.1.8.tar.gz:
Publisher:
pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-os
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_os-0.1.8.tar.gz -
Subject digest:
c83076d075e9fbcd032273f8da0ebcbcaa3f4d3adc287ecb25ec53777081fcd7 - Sigstore transparency entry: 1883490748
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-os@0b6f6a44d9be976d579bce363af9d666d67ff459 -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish-and-github-release-on-tag.yml@0b6f6a44d9be976d579bce363af9d666d67ff459 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_os-0.1.8-py3-none-any.whl.
File metadata
- Download URL: scitex_os-0.1.8-py3-none-any.whl
- Upload date:
- Size: 7.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f6faf4b9ae24abd3678ca0000d77993330a26366f2888a1b2b3e1c7eeb0b429
|
|
| MD5 |
bf3ad142c25cc53e0ae313254026b61c
|
|
| BLAKE2b-256 |
792250dbe9036f54212eecff32d354ba5a7a95fe8a439cb436156e87a6ac82f8
|
Provenance
The following attestation bundles were made for scitex_os-0.1.8-py3-none-any.whl:
Publisher:
pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-os
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_os-0.1.8-py3-none-any.whl -
Subject digest:
7f6faf4b9ae24abd3678ca0000d77993330a26366f2888a1b2b3e1c7eeb0b429 - Sigstore transparency entry: 1883490855
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-os@0b6f6a44d9be976d579bce363af9d666d67ff459 -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish-and-github-release-on-tag.yml@0b6f6a44d9be976d579bce363af9d666d67ff459 -
Trigger Event:
push
-
Statement type: