This project has been archived by its maintainers, and is no longer receiving any updates.
SciTeX Gen (scitex-gen)
General-purpose Python utilities for scientific workflows
Full Documentation · uv pip install scitex-gen[all]
scitex-gen collects miscellaneous helpers that have been useful across many
SciTeX projects: caching, normalization, environment detection, mat→npy
conversion, xml→dict parsing, a TimeStamper, dimension wranglers, and more.
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | One-off utilities scatter across scripts -- every research repo grows its own to_even, xml2dict, TimeStamper, NaN-aware z-score |
Curated misc bag -- scitex_gen.cache / to_z / to_nanz / xml2dict / TimeStamper / transpose / to_even / to_odd collected in one importable place |
| 2 | Environment detection ad-hoc -- "am I in a notebook? a script? interactive?" answered three different ways across projects | scitex_gen.detect_environment / is_notebook / is_script -- single canonical detector used across SciTeX peers |
| 3 | Legacy scitex.gen surface unstable -- helpers migrated to canonical peers (scitex_stats, scitex_os, scitex_str, ...) but old import paths still in use |
Backward-compatible re-exports + DeprecationWarning -- scitex_gen.check_host etc. still work, point to the new home, and warn at import time |
Installation
Requires Python >= 3.10.
pip install scitex-gen
Configuration
Copy .env.example to .env (or source it from your
shell) to override defaults such as SCITEX_DIR.
Architecture
scitex_gen/
├── _fs/ ← filesystem helpers (symlink, src, title2path, print_config)
├── _introspect/ ← introspection, caching, DimHandler, list_packages, mat2py, xml2dict
├── _ipython/ ← IPython/Jupyter helpers (notebook detection, embed, paste, less)
├── _legacy/ ← backward-compat wrappers (TimeStamper, deprecated start/close)
├── _numeric/ ← math/numerics (norm, norm_cache, symlog, to_even, to_odd, to_rank, transpose)
├── _skills/ ← agent-facing skill pages
├── misc.py ← connect_nums, float_linspace
├── path.py ← placeholder (path management lives in scitex-path)
├── _type.py / _var_info.py ← type annotations (optional, requires xarray)
└── _wrap.py ← text wrapping utility
Tiny single-purpose modules organized by domain. Most are pure Python;
to_z and the geometric-median variants opt into torch when available.
Several functions are re-exported from peer packages (scitex-context,
scitex-os, scitex-sh, etc.) for backward compatibility.
1 Interfaces
Python API
import scitex_gen
scitex_gen.cache(...)
scitex_gen.TimeStamper()
scitex_gen.detect_environment()
scitex_gen.xml2dict(...)
scitex_gen.to_z(...)
scitex_gen.to_even(7) # 6
scitex_gen.to_odd(8) # 7
scitex_gen.transpose(...)
scitex_gen.list_packages()
Demo
flowchart LR
A["raw tensor / array"] --> B["scitex_gen.to_z"]
B --> C["NaN-aware z-scored output"]
D["xml string"] --> E["scitex_gen.xml2dict"]
E --> F["nested dict"]
G["expensive func"] --> H["@scitex_gen.cache"]
H --> I["disk-backed result"]
>>> import scitex_gen as gen
>>> gen.to_even(7)
6
>>> gen.to_odd(8)
7
>>> ts = gen.TimeStamper(); ts("step1") # logs elapsed
Quick Start
import scitex_gen as gen
gen.cache(...)
gen.TimeStamper()
gen.xml2dict(...)
gen.to_z(tensor) # requires torch
gen.to_even(n)
gen.to_odd(n)
gen.transpose(...)
Status
Standalone fork of scitex.gen. The umbrella package's scitex.gen import
path is preserved via a sys.modules-alias bridge.
Decoupling notes:
scitex.{decorators,str,os,introspect,session,context,sh,dict}→scitex_*direct imports (peer packages).scitex.torch.nanstd→ optional viatry/exceptwith a torch-only fallback (only matters for_norm.to_z / to_nanz).import scitexremoved from_less.py(was unused in module body).- self-references in
_norm_cache.pyrewritten toscitex_gen.*.
Part of SciTeX
scitex-gen is part of SciTeX. Install via the
umbrella with pip install scitex[gen] to use as scitex.gen (Python).
The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:
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).
Metadata
Release files for scitex-gen 0.1.13
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 | |
|---|---|---|---|---|
| scitex_gen-0.1.13.tar.gz | 53.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scitex_gen-0.1.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 114.7 kB
Release files / scitex_gen-0.1.13.tar.gz
| Download URL | scitex_gen-0.1.13.tar.gz |
|---|---|
| Size | 53.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
923ca98e520852b9a01f59c8a43fc360f36b5072edf41b52c64f692a3a2e696a
|
|
BLAKE2b-256 checksum How to use checksums |
d5b6c849d1187254200d20ac65a62495032f8eb6457157c0a259e1d9a3912cf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logRelease files / scitex_gen-0.1.13-py3-none-any.whl
| Download URL | scitex_gen-0.1.13-py3-none-any.whl |
|---|---|
| Size | 61.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4954219bea894af3ddf7d41aac90c2da28b6710b5fb06351eb4785b64934b7c3
|
|
BLAKE2b-256 checksum How to use checksums |
e6b5f70d6aa69b1f2bdaf15ffd150f4111c07d72efa1e951334da10ff51131e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logSecurity for scitex-gen 0.1.13
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for scitex_gen-0.1.13.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logA 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.