sdkagent

packaging API reference

84 public APIs from packaging (pypa/packaging) — 31 classes, 19 functions, 34 methods. Signatures extracted by static analysis of the actual source.

Repository: pypa/packaging

KindCount
Classes31
Functions19
Methods34

API list

classsrc.packaging._elffile.ELFFile
Representation of an ELF executable.
methodsrc.packaging._elffile.ELFFile.interpreter() -> str | None
The path recorded in the ``PT_INTERP`` section header.
funcsrc.packaging._manylinux.platform_tags(archs:Sequence[str]) -> Iterator[str]
Generate manylinux tags compatible to the current platform.
funcsrc.packaging._musllinux.platform_tags(archs:Sequence[str]) -> Iterator[str]
Generate musllinux tags compatible to the current platform.
classsrc.packaging._ranges.BoundaryKind
Where a boundary marker sits in the version ordering.
classsrc.packaging._ranges.BoundaryVersion
A point on the version line between two real PEP 440 versions.
classsrc.packaging._ranges.LowerBound
Lower bound of a version range.
classsrc.packaging._ranges.UpperBound
Upper bound of a version range.
funcsrc.packaging._ranges.bounds_for_spec(op:str, version_str:str, version:Version) -> list[Interval]
Ranges for one specifier's ``(op, version_str)``.
funcsrc.packaging._ranges.matches_bounds_only(ranges:Sequence[Interval], version:Version) -> bool
Whether ``version`` falls within any of ``ranges``.
funcsrc.packaging._ranges.ranges_are_prerelease_only(ranges:Sequence[Interval]) -> bool
True when every range in *ranges* contains only pre-releases.
funcsrc.packaging._ranges.trim_release(release:tuple[int, ...]) -> tuple[int, ...]
Strip trailing zeros from a release tuple for normalized comparison.
funcsrc.packaging._ranges.wildcard_ranges(op:str, base:Version) -> list[Interval]
Ranges for ==V.* and !=V.*.
classsrc.packaging._tokenizer.ParserSyntaxError
The provided source text could not be parsed correctly.
classsrc.packaging._tokenizer.Tokenizer
Context-sensitive token parsing.
methodsrc.packaging._tokenizer.Tokenizer.check(name:str, *peek:bool=False) -> bool
Check whether the next token has the provided name.
methodsrc.packaging._tokenizer.Tokenizer.consume(name:str) -> None
Move beyond provided token name, if at current position.
methodsrc.packaging._tokenizer.Tokenizer.raise_syntax_error(message:str, *span_start:int | None=None, *span_end:int | None=None) -> NoReturn
Raise ParserSyntaxError at the given position.
methodsrc.packaging._tokenizer.Tokenizer.read() -> Token
Consume the next token and return it.
classsrc.packaging.dependency_groups.CyclicDependencyGroup
The dependency group includes form a cycle.
classsrc.packaging.dependency_groups.DependencyGroupInclude
A reference to another dependency group by name.
classsrc.packaging.dependency_groups.DependencyGroupResolver
A resolver for Dependency Group data.
methodsrc.packaging.dependency_groups.DependencyGroupResolver.resolve(group:str) -> tuple[Requirement, ...]
Resolve a dependency group to a list of requirements.
classsrc.packaging.direct_url.ArchiveInfo
The archive information of a :class:`DirectUrl`.
classsrc.packaging.direct_url.DirInfo
The local directory information of a :class:`DirectUrl`.
classsrc.packaging.direct_url.DirectUrl
A class representing a direct URL.
methodsrc.packaging.direct_url.DirectUrl.from_dict(d:Mapping[str, Any]) -> Self
Create and validate a DirectUrl instance from a JSON dictionary.
classsrc.packaging.direct_url.DirectUrlValidationError
Raised when when input data is not spec-compliant.
classsrc.packaging.direct_url.VcsInfo
The version control information of a :class:`DirectUrl`.
classsrc.packaging.markers.Marker
Represents a parsed dependency marker expression.
methodsrc.packaging.markers.Marker.evaluate(environment:Mapping[str, str | AbstractSet[str]] | None=None, context:EvaluateContext='metadata') -> bool
Evaluate a marker.
classsrc.packaging.markers.UndefinedComparison
Raised when evaluating an unsupported marker comparison.
classsrc.packaging.metadata.InvalidMetadata
A metadata field contains invalid data.
classsrc.packaging.metadata.Metadata
Representation of distribution metadata.
methodsrc.packaging.metadata.Metadata.as_rfc822() -> RFC822Message
Return an RFC822 message with the metadata.
methodsrc.packaging.metadata.Metadata.from_email(data:bytes | str, *validate:bool=True) -> Metadata
Parse metadata from email headers.
methodsrc.packaging.metadata.Metadata.from_raw(data:RawMetadata, *validate:bool=True) -> Metadata
Create an instance from :class:`RawMetadata`.
classsrc.packaging.metadata.RawMetadata
A dictionary of raw core metadata.
funcsrc.packaging.metadata.parse_email(data:bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]
Parse a distribution's metadata stored as email headers (e.g.
classsrc.packaging.pylock.Pylock
A class representing a pylock file.
methodsrc.packaging.pylock.Pylock.from_dict(d:Mapping[str, Any]) -> Self
Create and validate a Pylock instance from a TOML dictionary.
methodsrc.packaging.pylock.Pylock.to_dict() -> Mapping[str, Any]
Convert the Pylock instance to a TOML dictionary.
methodsrc.packaging.pylock.Pylock.validate() -> None
Validate the Pylock instance against the specification.
classsrc.packaging.pylock.PylockSelectError
Base exception for errors raised by :meth:`Pylock.select`.
classsrc.packaging.pylock.PylockUnsupportedVersionError
Raised when encountering an unsupported `lock_version`.
classsrc.packaging.pylock.PylockValidationError
Raised when when input data is not spec-compliant.
funcsrc.packaging.pylock.is_valid_pylock_path(path:Path) -> bool
Check if the given path is a valid pylock file path.
classsrc.packaging.requirements.Requirement
Parse a requirement.
classsrc.packaging.specifiers.Specifier
This class abstracts handling of version specifiers.
methodsrc.packaging.specifiers.Specifier.operator() -> str
The operator of this specifier.
methodsrc.packaging.specifiers.Specifier.version() -> str
The version of this specifier.
classsrc.packaging.specifiers.SpecifierSet
This class abstracts handling of a set of version specifiers.
methodsrc.packaging.specifiers.SpecifierSet.is_disjoint(other:SpecifierSet) -> bool
Return whether this set and other share no matching versions.
classsrc.packaging.tags.Tag
A representation of the tag triple for a wheel.
methodsrc.packaging.tags.Tag.abi() -> str
The supported ABI.
methodsrc.packaging.tags.Tag.interpreter() -> str
The interpreter name, e.g.
methodsrc.packaging.tags.Tag.platform() -> str
The OS/platform.
classsrc.packaging.tags.TooManyTagsError
Raised when a compressed tag set exceeds the configured limit.
funcsrc.packaging.tags.android_platforms(api_level:int | None=None, abi:str | None=None) -> Iterator[str]
Yields the :attr:`~Tag.platform` tags for Android.
funcsrc.packaging.tags.interpreter_name() -> str
Returns the name of the running interpreter.
funcsrc.packaging.tags.interpreter_version(*warn:bool=False) -> str
Returns the running interpreter's version.
funcsrc.packaging.tags.ios_platforms(version:AppleVersion | None=None, multiarch:str | None=None) -> Iterator[str]
Yields the :attr:`~Tag.platform` tags for iOS.
funcsrc.packaging.tags.mac_platforms(version:AppleVersion | None=None, arch:str | None=None) -> Iterator[str]
Yields the :attr:`~Tag.platform` tags for macOS.
funcsrc.packaging.tags.parse_tag(tag:str, *validate_order:bool=False, *limit:int | None=None) -> frozenset[Tag]
Parses the provided tag (e.g.
funcsrc.packaging.utils.canonicalize_version(version:Version | str, *strip_trailing_zero:bool=True) -> str
Return a canonical form of a version as a string.
funcsrc.packaging.utils.is_normalized_name(name:str) -> bool
Check if a name is a normalized project name (i.e.
classsrc.packaging.version.InvalidVersion
Raised when a version string is not a valid version.
classsrc.packaging.version.Version
This class abstracts handling of a project's versions.
methodsrc.packaging.version.Version.base_version() -> str
The "base version" of the version.
methodsrc.packaging.version.Version.dev() -> int | None
The development number of the version.
methodsrc.packaging.version.Version.epoch() -> int
The epoch of the version.
methodsrc.packaging.version.Version.is_devrelease() -> bool
Whether this version is a development release.
methodsrc.packaging.version.Version.is_postrelease() -> bool
Whether this version is a post-release.
methodsrc.packaging.version.Version.is_prerelease() -> bool
Whether this version is a pre-release.
methodsrc.packaging.version.Version.local() -> str | None
The local version segment of the version.
methodsrc.packaging.version.Version.major() -> int
The first item of :attr:`release` or ``0`` if unavailable.
methodsrc.packaging.version.Version.micro() -> int
The third item of :attr:`release` or ``0`` if unavailable.
methodsrc.packaging.version.Version.minor() -> int
The second item of :attr:`release` or ``0`` if unavailable.
methodsrc.packaging.version.Version.post() -> int | None
The post-release number of the version.
methodsrc.packaging.version.Version.pre() -> tuple[Literal['a', 'b', 'rc'], int] | None
The pre-release segment of the version.
methodsrc.packaging.version.Version.public() -> str
The public portion of the version.
methodsrc.packaging.version.Version.release() -> tuple[int, ...]
The components of the "release" segment of the version.
funcsrc.packaging.version.normalize_pre(letter:str) -> str
Normalize the pre-release segment of a version string.
funcsrc.packaging.version.parse(version:str) -> Version
Parse the given version string.

About this data

These signatures were extracted from the public source of pypa/packaging using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries