Logging utilities for the SciTeX ecosystem
Project description
scitex-logging
Logging utilities for SciTeX — SUCCESS/FAIL log levels, typed exception hierarchy, Tee context-manager.
Full Documentation · uv pip install scitex-logging[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | stdlib logging has only 5 levels -- experiment scripts want a distinct SUCCESS and FAIL signal that stands out in grep |
SUCCESS + FAIL levels added -- color-coded, level-aware handlers; drop-in compatible with getLogger(__name__) |
| 2 | raise ValueError("shape mismatch") loses context -- every package rolls its own exception hierarchy |
30+ typed exceptions -- SciTeXError root + ShapeError, DTypeError, ConfigKeyError, PDFDownloadError, ...; isinstance(e, DataError) catches the whole class |
| 3 | Tee stdout-to-file is a recipe -- every script implements it differently | Tee("run.log") context-manager -- one import, no boilerplate |
Installation
pip install scitex-logging
1 Interfaces
Python API
import scitex_logging
# Configure logging
scitex_logging.configure(level=scitex_logging.INFO, enable_file=True)
# Get a logger
import logging
logger = logging.getLogger(__name__)
logger.info("Hello from SciTeX logging")
# Tee stdout/stderr to log files
import sys
sys.stdout, sys.stderr = scitex_logging.tee(sys)
# Custom error classes
from scitex_logging import SciTeXError, SaveError
# Warning utilities
from scitex_logging import warn_deprecated, warn_performance
# LLM session log parsing
log = scitex_logging.llm.load("session.jsonl")
log.summary()
log.render("out.html")
Architecture
scitex_logging/
├── _config.py ← `configure()` entry point + level registration
├── _levels.py ← SUCCESS / FAIL custom log levels
├── _tee.py ← stdout/stderr Tee context-manager
├── exceptions/ ← 30+ typed `SciTeXError` subclasses
│ ├── _data.py ← ShapeError, DTypeError, ...
│ ├── _config.py ← ConfigKeyError, ...
│ └── _network.py ← PDFDownloadError, ...
├── warnings/ ← `warn_deprecated`, `warn_performance`
└── llm/ ← Claude / LLM session-log parsers
Demo
flowchart LR
A[script.py] -->|getLogger| B[scitex_logging]
B --> C{level}
C -->|SUCCESS| D[green log + Tee → run.log]
C -->|FAIL| E[red log + Tee → run.log]
C -->|ERROR| F[typed SciTeXError raised]
import logging, scitex_logging as sxl
sxl.configure(level=sxl.INFO, enable_file=True)
log = logging.getLogger(__name__)
log.success("model converged") # green
log.fail("validation failed") # red, distinct from ERROR
2026-05-07 12:00:00 SUCCESS model converged
2026-05-07 12:00:01 FAIL validation failed
Part of SciTeX
scitex-logging is part of SciTeX. Install via
the umbrella with pip install scitex[logging] to use as
scitex.logging (Python).
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
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_logging-0.1.4.tar.gz.
File metadata
- Download URL: scitex_logging-0.1.4.tar.gz
- Upload date:
- Size: 8.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a256867ef5f9294a49cf05493045b8d03611b51503ff7b4ccb2385c6612882fc
|
|
| MD5 |
97a038e228eb098f46f41f9ec5d41140
|
|
| BLAKE2b-256 |
bf4f2468975ea1dd1ddeabda92d339d2d52e7208bbd48b131f961ad8f0f8f3f6
|
Provenance
The following attestation bundles were made for scitex_logging-0.1.4.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-logging
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_logging-0.1.4.tar.gz -
Subject digest:
a256867ef5f9294a49cf05493045b8d03611b51503ff7b4ccb2385c6612882fc - Sigstore transparency entry: 1506327405
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-logging@08943ae47f3aa190b8a1ca447f263f9838071028 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@08943ae47f3aa190b8a1ca447f263f9838071028 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_logging-0.1.4-py3-none-any.whl.
File metadata
- Download URL: scitex_logging-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.4 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 |
527ae8a57be040443c932e16478fc93a8a120d18fd1d8e0eea7322fc8da7a3b2
|
|
| MD5 |
5fd6a8d259c4ab4317bb5243d3055a05
|
|
| BLAKE2b-256 |
702556ed8b0c9c202555e9313ddf5c3fee2e44387b634d75c087ab1c49fceaaf
|
Provenance
The following attestation bundles were made for scitex_logging-0.1.4-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-logging
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_logging-0.1.4-py3-none-any.whl -
Subject digest:
527ae8a57be040443c932e16478fc93a8a120d18fd1d8e0eea7322fc8da7a3b2 - Sigstore transparency entry: 1506327502
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-logging@08943ae47f3aa190b8a1ca447f263f9838071028 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@08943ae47f3aa190b8a1ca447f263f9838071028 -
Trigger Event:
push
-
Statement type: