jaraco.context
Useful decorators and context managers
Install
jaraco-context on PyPI
pip
pip install jaraco-contextuv
uv add jaraco-contextpoetry
poetry add jaraco-contextPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — backports.tarfile |
| Maintenance | actively maintained — 146 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: jaraco_context-6.1.2-py3-none-any.whl
About jaraco.context
from the package's own PyPI description — quoted content, verbatim
.. image:: https://img.shields.io/pypi/v/jaraco.context.svg :target: https://pypi.org/project/jaraco.context
.. image:: https://img.shields.io/pypi/pyversions/jaraco.context.svg
.. image:: https://github.com/jaraco/jaraco.context/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.context/actions?query=workflow%3A%22tests%22 :alt: tests
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff
.. image:: https://readthedocs.org/projects/jaracocontext/badge/?version=latest :target: https://jaracocontext.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/badge/skeleton-2025-informational :target: https://blog.jaraco.com/skeleton
.. image:: https://tidelift.com/badges/package/pypi/jaraco.context :target: https://tidelift.com/subscription/pkg/pypi-jaraco.context?utm_source=pypi-jaraco.context&utm_medium=readme
Highlights
See the docs linked from the badge above for the full details, but here are some features that may be of interest.
ExceptionTrapprovides a...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Provides decorators and context managers for exception handling, directory changes, tarball operations, and interrupt handling in Python applications.
Low friction: pure Python wheel with a single runtime dependency (backports.tarfile) and active maintenance—last release 146 days ago with recent commits.
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Usage
pip install jaraco.context
from jaraco.context import ExceptionTrap
with ExceptionTrap() as trap:
# code that may raise
pass
if trap.exception:
# handle exception
Requires Python 3.10 or later.
Verdict: Production-stable utility library with permissive MIT licensing, no known vulnerabilities, and minimal dependencies. Active maintenance and top-1000 popularity make it a low-risk choice for adding context management and exception-handling utilities to Python 3.10+ projects.
Needs verification
- Whether backports.tarfile is required only for tarball() feature or for all functionality.
- Performance characteristics or overhead of ExceptionTrap compared to native exception handling.
Similar packages
permissive · top 1,000 on PyPI
jaraco.classespermissive · top 1,000 on PyPI
backports.tarfilepermissive · top 1,000 on PyPI
zipppermissive · top 100 on PyPI
keyringpermissive · top 1,000 on PyPI
decoratorpermissive · top 1,000 on PyPI
importlib-resourcespermissive · top 1,000 on PyPI
importlib-metadatapermissive · top 100 on PyPI
setuptoolspermissive · top 100 on PyPI
inflectpermissive · top 1,000 on PyPI