--- id: priority version: "2.0.0" license: MIT License license_treatment: permissive maintenance: aging --- # priority — A pure-Python implementation of the HTTP/2 priority tree License: permissive · Maintenance: aging · Downloads: 7.4M/mo ## What it is and what it does Priority is a pure-Python implementation of the HTTP/2 stream priority algorithm specified in RFC 7540 Section 5.3. It provides a priority tree data structure that servers can use to fairly schedule resource allocation across multiple concurrent HTTP/2 streams, respecting client-expressed preferences for stream weights and dependencies. The implementation is based on the H2O project's approach and is used by nghttp2. The package exposes a simple API: insert streams into the tree with optional weights and dependencies, iterate over the tree to determine which stream should send data next, and call block/unblock/reprioritize methods to update the tree as stream states change. This allows servers to automatically emit stream data in conformance with RFC 7540 without manual priority logic. Use it for: - HTTP/2 server implementations that need to schedule multiple concurrent streams fairly according to client priority hints. - Proxies or load balancers that must respect HTTP/2 stream priorities when forwarding requests. - Testing or validating HTTP/2 priority behavior in protocol implementations. - Applications that need to simulate or understand HTTP/2 priority scheduling mechanics. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements HTTP/2 stream priority scheduling according to RFC 7540, allowing servers to allocate resources fairly across multiple concurrent streams based on client-expressed preferences. Yes, if you are building or maintaining an HTTP/2 server or proxy that needs RFC 7540-compliant priority scheduling. The package has no dependencies, low install friction, and a permissive license. However, note that the last release was 2021-06-27 with no updates since; if you need active maintenance or support for very recent Python versions, verify compatibility first or consider whether the aging status affects your use case. ## Install pip install priority uv add priority poetry add priority ## Installing priority Before you install: Low install friction with no runtime dependencies. Maintenance is aging—last release was 2021-06-27 and the repository has not been updated since then, though it remains unarchived and the package is marked Production/Stable. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: from priority import PriorityTree p = PriorityTree() p.insert_stream(stream_id=1) p.insert_stream(stream_id=3, depends_on=1) for stream_id in p: # send_data(stream_id) Requires Python 3.6.1 or later; supports CPython and PyPy. Verify before relying: - Whether the package remains compatible with Python versions released after 2021 without explicit testing. - Current real-world usage patterns and whether the aging maintenance status affects adoption in modern HTTP/2 stacks. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 7.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags HTTP/2 priority tree, stream scheduling, RFC 7540 priority, HTTP/2 resource allocation, priority queue implementation, stream weighting, HTTP/2 flow control, http2, stream-scheduling [View on SkillFed](https://skillfed.io/packages/priority) · [View on PyPI](https://pypi.org/project/priority/)