pyre-extensions
Type system extensions for use with the pyre type checker
What it is and what it does
Pyre Extensions is a companion library to the Pyre type checker that adds three main capabilities to Python's typing system. It defines ParameterSpecification, a special type variable that captures callable parameter specifications (argument names, types, and whether they're required) rather than just types—useful for typing decorators that preserve a function's signature while transforming its return type. It provides none_throws, a utility function that asserts an Optional value is not None and returns it, making assumptions about Optional types explicit in code. It also includes safe_json, a drop-in replacement for the standard json module that validates parsed JSON against a specified type schema (using TypedDict for complex structures) and raises InvalidJson if the data doesn't match.
The package is designed as a lightweight companion to Pyre, with minimal dependencies (only typing-inspect and typing-extensions). It has been dormant for 630 days, suggesting the API is stable but no longer under active development. The library is classified as Alpha and intended for developers using Pyre for static type checking who need these specific typing patterns.
Use it for:
- Type decorators that preserve function signatures while changing return types using ParameterSpecification
- Validating JSON API responses against a TypedDict schema before processing
- Making Optional type handling explicit by asserting non-None values with none_throws
- Parsing configuration files with known structure and enforcing type safety at load time
- Catching JSON schema mismatches early in development rather than at runtime
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides typing extensions for the Pyre type checker, including ParameterSpecification for decorator typing, none_throws for explicit Optional handling, and safe_json for type-safe JSON parsing.
Yes, if you use Pyre for type checking and need ParameterSpecification or type-safe JSON parsing. The low install friction and permissive license make it a low-risk addition. However, dormant maintenance (630 days since last release) means no active bug fixes or feature development; evaluate whether your use case requires these features and whether safe_json meets your performance and validation needs.
Install
pyre-extensions on PyPI
pip
pip install pyre-extensionsuv
uv add pyre-extensionspoetry
poetry add pyre-extensionsInstalling pyre-extensions
Before you install
Low install friction with only two runtime dependencies (typing-inspect and typing-extensions). Dormant maintenance status—last release 630 days ago—suggests stability but no active development.
License in practice
MIT license (permissive) imposes no restrictions on use, modification, or redistribution in proprietary or open-source projects.
Quickstart
pip install pyre-extensions
from pyre_extensions import safe_json
from typing import List
result = safe_json.loads('[1, 2, 3]', List[int])
print(result) # [1, 2, 3]
Verify before relying
- Whether ParameterSpecification remains necessary given native ParamSpec support in recent Python versions
- Current compatibility with modern Python versions and Pyre's latest releases
- Whether safe_json validation performance is suitable for large or streaming JSON
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — typing-inspect, typing-extensions |
| Maintenance | dormant — 630 days since the last release |
| First released | |
| Downloads | 1,706,205/month — #3,634 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyre_extensions-0.0.32-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
typing-inspectProvides runtime inspection utilities for…
permissive · top 1,000 on PyPI
django-typesProvides type stubs for Django to enable static…
permissive · top 5,000 on PyPI
resultProvides a Rust-inspired Result type for Python…
permissive · top 5,000 on PyPI
typing-validationRuntime validation of Python objects against…
copyleft · top 15,000 on PyPI
mypy-extensionsProvides type system extensions for Python…
unclear · top 1,000 on PyPI
typing-jsonProvides type-aware JSON serialization and…
permissive · top 15,000 on PyPI
pyre-checkPysa is a static analysis tool that tracks data…
permissive · top 15,000 on PyPI
strongtypingA runtime type-checking decorator that…
permissive · top 15,000 on PyPI
daciteConverts dictionaries into dataclass instances…
permissive · top 1,000 on PyPI
pyreflyPyrefly is a fast type checker and language…
permissive · top 5,000 on PyPI