Skip to main content

Small cross-cutting utilities: interactive keyboard input (wait_key, count), parameter-grid iteration (count_grids, yield_grids), and regex string search (search)

Project description

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

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

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_etc-0.1.10.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_etc-0.1.10-py3-none-any.whl (8.5 MB view details)

Uploaded Python 3

File details

Details for the file scitex_etc-0.1.10.tar.gz.

File metadata

  • Download URL: scitex_etc-0.1.10.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

Hashes for scitex_etc-0.1.10.tar.gz
Algorithm Hash digest
SHA256 f288632b3456b22ddfa5d9da23d74cd263208afdbd7f6dcd5f39de5c03d6ab45
MD5 766db43e1152efa7aa4b5ee2ae0d157e
BLAKE2b-256 0f6025536c6aa0f848c8f05d6d5b9bfaea3933f73c80a13fea0278cb46c2345e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_etc-0.1.10.tar.gz:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-etc

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_etc-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: scitex_etc-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 8.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_etc-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 72145abf4ae01984a6163dd8b8613a1072c501a7a482b0a730ae03fb1a472cb5
MD5 db5bf9e0536c1c0e996ac9b0b2658cc3
BLAKE2b-256 024cb8c6125bb40a6d4eb36f7c752ed25e443932b1076656b4c583e0fd778501

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_etc-0.1.10-py3-none-any.whl:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-etc

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