Skip to main content
https://img.shields.io/pypi/v/jaraco.context.svg https://img.shields.io/pypi/pyversions/jaraco.context.svg tests Ruff https://readthedocs.org/projects/jaracocontext/badge/?version=latest https://img.shields.io/badge/skeleton-2025-informational https://tidelift.com/badges/package/pypi/jaraco.context

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 general-purpose wrapper for trapping exceptions and then acting on the outcome. Includes passes and raises decorators to replace the result of a wrapped function by a boolean indicating the outcome of the exception trap. See this keyring commit for an example of it in production.

  • suppress simply enables contextlib.suppress as a decorator.

  • on_interrupt is a decorator used by CLI entry points to affect the handling of a KeyboardInterrupt. Inspired by Lucretiel/autocommand#18.

  • pushd is similar to pytest’s monkeypatch.chdir or path’s default context, changes the current working directory for the duration of the context.

  • tarball will download a tarball, extract it, change directory, yield, then clean up after. Convenient when working with web assets.

  • null is there for those times when one code branch needs a context and the other doesn’t; this null context provides symmetry across those branches.

For Enterprise

Available as part of the Tidelift Subscription.

This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.

Learn more.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jaraco_context-6.1.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

jaraco_context-6.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file jaraco_context-6.1.1.tar.gz.

File metadata

  • Download URL: jaraco_context-6.1.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for jaraco_context-6.1.1.tar.gz
Algorithm Hash digest
SHA256 bc046b2dc94f1e5532bd02402684414575cc11f565d929b6563125deb0a6e581
MD5 9e91175801a3694e0b0d40e6eacc70b7
BLAKE2b-256 277bc3081ff1af947915503121c649f26a778e1a2101fd525f74aef997d75b7e

See more details on using hashes here.

File details

Details for the file jaraco_context-6.1.1-py3-none-any.whl.

File metadata

  • Download URL: jaraco_context-6.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for jaraco_context-6.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0df6a0287258f3e364072c3e40d5411b20cafa30cb28c4839d24319cecf9f808
MD5 6e07ba03b9229669f079778484fc46f8
BLAKE2b-256 f449c152890d49102b280ecf86ba5f80a8c111c3a155dafa3bd24aeb64fde9e1

See more details on using hashes here.

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