skillfed

jaraco.context

Useful decorators and context managers

jaraco-context Permissive license MIT Active 3 v6.1.2 released

Install

jaraco-context on PyPI

pip

pip install jaraco-context

uv

uv add jaraco-context

poetry

poetry add jaraco-context

Package 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

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.

  • ExceptionTrap provides a...

Read as markdown · JSON record · Source repository

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.
context managers decoratorsexception trapping wrappersuppress decoratorkeyboard interrupt handlerpushd context managertarball download extractcli interrupt handling

Similar packages