Skip to main content

scitex-etc

SciTeX

Interactive keyboard input utilities for the SciTeX ecosystem.

Full Documentation · uv pip install scitex-etc[all]

pypi python docs

tests install-check cov


Problem and Solution

# Problem Solution
1 Scripts that pause for a keypress need raw-stdin + termios gymnastics — 15 lines of OS-dependent boilerplate wait_key() / count() — one import; handles Linux/macOS/Windows; falls back cleanly when stdin isn't a TTY

Installation

pip install scitex-etc

Architecture

scitex-etc/
├── src/scitex_etc/
│   ├── _wait_key.py     # cross-platform raw-stdin keypress
│   └── _count.py        # countdown helper
└── tests/

1 Interfaces

Python API
import multiprocessing
from scitex_etc import wait_key, count

# Run the counter in a subprocess, wait for 'q' to stop it.
p = multiprocessing.Process(target=count)
p.start()
wait_key(p)  # Blocks until 'q' is pressed, then terminates the process
Media handling (scitex_etc.media.render)
from scitex_etc.media import render

# Classify a file by its extension
render.classify("fig.png")          # {"type": "image", "path": "fig.png", "ext": ".png"}

# Detect media refs in tool output
render.detect("Saved /proj/fig.png", root_path="/proj")
# [{"type": "image", "path": "fig.png", "ext": ".png"}]

# Render to a target: terminal (OSC overlay), chat, or markdown
render.show("fig.png", target="markdown")  # "![fig.png](fig.png)"

Also available as a CLI (python -m scitex_etc.media.render show|classify|detect) and as MCP tools (scitex_etc.media.render.mcp_server).

Demo

flowchart LR
    User[User keypress] --> TTY{stdin is TTY?}
    TTY -- yes --> Termios[termios raw mode]
    TTY -- no --> Fallback[readline fallback]
    Termios --> Key[key string]
    Fallback --> Key

Quick Start

import multiprocessing
from scitex_etc import wait_key, count

# count() prints an incrementing counter forever (1 per second).
# Run it in a subprocess and use wait_key() to stop on 'q'.
p = multiprocessing.Process(target=count)
p.start()
wait_key(p)

Part of SciTeX

scitex-etc is part of SciTeX. Install via the umbrella with pip install scitex[etc] to use as scitex.etc (Python) or scitex etc ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. 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


SciTeX

Metadata

Release files for scitex-etc 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scitex-etc 0.2.1
File Size Uploaded Provenance
scitex_etc-0.2.1.tar.gz 8.8 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scitex-etc 0.2.1
File Interpreter ABI Platform
scitex_etc-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 MB

Release files / scitex_etc-0.2.1.tar.gz

Download URL scitex_etc-0.2.1.tar.gz
Size 8.8 MB
Tags Source
SHA-256 checksum
How to use checksums
97b78266bcd5171155d968a0ca173b4c6de6aaa7b3fea029e38c0bffe947b423
BLAKE2b-256 checksum
How to use checksums
b043f8ba9e9fc2870412e883c080a1b87eef36fbafecde457b49e74c11b7d142
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 20, 2026.

Transparency log

Release files / scitex_etc-0.2.1-py3-none-any.whl

Download URL scitex_etc-0.2.1-py3-none-any.whl
Size 8.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b12e48c657d93d09d8fb53e47914c12d4100b6ab84542c875e817d62c075b554
BLAKE2b-256 checksum
How to use checksums
db250fd127f9bf508feb53dadfe308abbb97c86e25a0d41cada682f37ef12389
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 20, 2026.

Transparency log

Security for scitex-etc 0.2.1

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.

Select from 2 files

Attestation for scitex_etc-0.2.1.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 20, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page