Skip to main content

Prefix stdout/stderr lines with call stack context.

Project description

yprint

yprint prefixes stdout/stderr lines with a colored call stack breadcrumb. It does this by preloading a small C shim that intercepts writes and lets the Python runtime update a per-thread prefix.

Install

pip install yprint

Usage

yprint -- python your_script.py
yprint -- bash -c 'python your_script.py'

Options

  • --only PATH (repeatable): Only show frames under the given path(s).
  • --prefix-width N: Fixed width for the prefix column.

Environment

  • YPRINT_ONLY: Colon-separated list of allowed paths (same as --only).
  • YPRINT_PREFIX_WIDTH: Fixed width for the prefix column.
  • YPRINT_COLOR: always or never to force color on/off.
  • YPRINT_CACHE_DIR: Override where the preload library is compiled.
  • YPRINT_ENABLE: Set to 1 to auto-enable via sitecustomize.

yprint compiles the preload library on first run; a C compiler (cc) must be available.

Dev / Release

pip install -e ".[dev]"
python -m build
python -m twine upload dist/*

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

yprint-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

yprint-0.1.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file yprint-0.1.1.tar.gz.

File metadata

  • Download URL: yprint-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yprint-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b790514588c3dc19b6a365966cd006a2191e001f93e6a291fa50b0ced77648fc
MD5 86d8c31ae0c781bd35fdb6fd86201101
BLAKE2b-256 88e8a81a5a0c2a7a806a701ef65c016515a71c70d2c64c0523ae87830999067e

See more details on using hashes here.

Provenance

The following attestation bundles were made for yprint-0.1.1.tar.gz:

Publisher: workflow.yaml on yieldthought/yprint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yprint-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yprint-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yprint-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd3d4395126c82823ab5fb5877f19e37d0460a0fd7a18696bb952e55fc1db02b
MD5 159064f65a2552577d48bc7ace7bd2f8
BLAKE2b-256 328e40ea86889b240f75ae44adff523d224a12f1670cdd29741be9814e5398d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for yprint-0.1.1-py3-none-any.whl:

Publisher: workflow.yaml on yieldthought/yprint

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