talira

packaging

Core utilities for Python packages

open sourceApache-2.0 OR BSD-2-Clausefree

packaging is the Python Packaging Authority's library of reusable core utilities for Python's packaging interoperability specifications: the ones with one correct behaviour, such as PEP 440 versions, or that gain from one shared implementation, such as PEP 425 tags. Its modules handle versions, version specifiers and ranges, environment markers, licence expressions, requirements, metadata, platform tags, lock files, direct URLs and dependency groups. It uses calendar-based versioning and is available under either the Apache-2.0 or the BSD-2-Clause licence.

Problems it solves

  • parse and compare Python version numbers the way pip does
  • check whether a version matches a requirement like >=1.2,<2 in my Python tool
  • read wheel compatibility tags and environment markers correctly

Features

  • PEP 440 version parsing and comparison
  • version specifiers and ranges
  • environment markers and requirements
  • platform compatibility tags (PEP 425)
  • core metadata, licence expressions, lock files and dependency groups