Crate pep440[][src]

Expand description


This package provides a full Python PEP440 parser for Rust.

This crate, like the Python packaging test file from which many tests were taken, is dual licensed under the terms of the Apache License, Version 2.0, and the BSD License.

The default mode uses a regex which is copied directly from the PEP440 specification, to do parsing. An alternative mode is planned for the future, which will use the awesome nom parser-combinator library to do parsing. Both parsing modes will be supported (once they are both implemented), and might have performance differences, but should otherwise be identical.

Currently, the following is implemented:

  • Parsing of version strings.
  • An is_canonical() function which can check whether or not a version string is in canonical form.
  • Tons of tests (copied from packaging.version).


Represents a version parsed as a PEP440-compliant version string.


Segments of the “local” part of a version (anything after a +).

The pre-release component of a version, such as rcN, bN, or aN.