Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

contextclass

Alternative interface to context variables for practical scenarios.

>>> from contextclass import ContextLocal, enter, current
>>> from dataclasses import dataclass

>>> @dataclass
... class Foo(ContextLocal):
...     x: int | None = None

>>> @enter(Foo, x=1)
... def f() -> None:
...     print(current(Foo))
>>> f()
Foo(x=1)

>>> with Foo.context(x=2):
...     print(Foo.current.x)
2

>>> @Foo.context(x=3)
... def f() -> None:
...     print(Foo.current.x)
>>> f()
3

Works with type hints:

image

Metadata

Release files for contextclass 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextclass 0.5.0
File Size Uploaded Provenance Actions
contextclass-0.5.0.tar.gz 43.0 kB With provenance Details for contextclass-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for contextclass 0.5.0
File Interpreter ABI Platform Actions
contextclass-0.5.0-py3-none-any.whl Python 3 none any Details for contextclass-0.5.0-py3-none-any.whl

Total release size: 46.3 kB

Release files / contextclass-0.5.0.tar.gz

Download URL contextclass-0.5.0.tar.gz
Size 43.0 kB
Tags Source
SHA-256 checksum
How to use checksums
285570364b89623dd92e619fa2c2697fe61be84396cb4b3eae3df90b964dbbfd
BLAKE2b-256 checksum
How to use checksums
c847e43dad103e12b3295f443f1424f418f53ae6f8a4f5492ad11b4c9cd6abaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Release files / contextclass-0.5.0-py3-none-any.whl

Download URL contextclass-0.5.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be4996e6b4c5756d306926db805c03ebc334d747388461e40a2fa45141a5a2a
BLAKE2b-256 checksum
How to use checksums
3f3837b5a8c14f519798eee38c1359262abddba909dff5e660418b2233a0d6f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Security for contextclass 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for contextclass-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page