Execution-context detection (script vs Jupyter vs IPython) + stdout/stderr suppression — standalone module from the SciTeX ecosystem
Project description
scitex-context
Execution-context detection (script vs Jupyter vs IPython) and output suppression helpers.
Full Documentation · pip install scitex-context
Installation
pip install scitex-context
Quick Start
import scitex_context as ctx
if ctx.is_notebook():
print("Running inside Jupyter")
with ctx.suppress_output():
noisy_function()
1 Interfaces
Python API
import scitex_context as ctx
# Environment detection
ctx.detect_environment() # "script" | "notebook" | "ipython"
ctx.is_script() # True if running under `python foo.py`
ctx.is_notebook() # True under Jupyter
ctx.is_ipython() # True under bare IPython
ctx.get_output_directory() # Conventional output dir for current context
# Notebook helpers (no-op outside a notebook)
ctx.get_notebook_path()
ctx.get_notebook_directory()
ctx.get_notebook_name()
ctx.get_notebook_info_simple()
# Output suppression
with ctx.suppress_output():
noisy_function()
with ctx.quiet(): # alias
chatty_lib_call()
Status
Standalone fork of scitex.context. Pure stdlib — zero deps. The umbrella
package's scitex.context import path is preserved via a sys.modules-alias
bridge.
Part of SciTeX
scitex-context is part of SciTeX.
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
Release history Release notifications | RSS feed
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_context-0.1.2.tar.gz.
File metadata
- Download URL: scitex_context-0.1.2.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdb499954fa3547647a6fabcb0f116f94c3d6f1e93833ea6d62d356da49710ff
|
|
| MD5 |
d19c861f3f6afa2828b900c419e020dc
|
|
| BLAKE2b-256 |
89b50122ffe7a4234ed0b7ec83becb83a895ac1d584d46304fb4ab7b3887d1a9
|
Provenance
The following attestation bundles were made for scitex_context-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_context-0.1.2.tar.gz -
Subject digest:
fdb499954fa3547647a6fabcb0f116f94c3d6f1e93833ea6d62d356da49710ff - Sigstore transparency entry: 1417444569
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-context@5ff40d22f32c18dd32a114389421d587cc31a91c -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5ff40d22f32c18dd32a114389421d587cc31a91c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scitex_context-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scitex_context-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55dc5d1adeca0c2283261270e540315ed91a50ed3e795f304b0d35cd9414fff8
|
|
| MD5 |
07d30a96a0bd61b9792805bb1934cff9
|
|
| BLAKE2b-256 |
5233665ab022d824ed4fab9ad7ba494ed2a7ceda84557551960890c512c7abfd
|
Provenance
The following attestation bundles were made for scitex_context-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_context-0.1.2-py3-none-any.whl -
Subject digest:
55dc5d1adeca0c2283261270e540315ed91a50ed3e795f304b0d35cd9414fff8 - Sigstore transparency entry: 1417444600
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-context@5ff40d22f32c18dd32a114389421d587cc31a91c -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5ff40d22f32c18dd32a114389421d587cc31a91c -
Trigger Event:
workflow_dispatch
-
Statement type: