Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# `validate_pyproject.formats`

The functions in this module are used to validate schemas with the format JSON Schema keyword.

The correspondence is given by replacing the `_` character in the name of the function with a `-` to obtain the format name and vice versa.

validate_pyproject.formats.SPDX(value: str) → bool

  See PyPA’s License-Expression specification (added in PEP 639).

validate_pyproject.formats.int(value: int) → bool

  Signed 64-bit integer (\(-2^{63} \leq x < 2^{63}\))

validate_pyproject.formats.pep440(version: str) → bool

  See PyPA’s version specification (initially introduced in PEP 440).

validate_pyproject.formats.pep508(value: str) → bool

  See PyPA’s dependency specifiers (initially introduced in PEP 508).

validate_pyproject.formats.pep508_identifier(name: str) → bool

  See PyPA’s name specification (initially introduced in PEP 508#names).

validate_pyproject.formats.pep508_versionspec(value: str) → bool

  Expression that can be used to specify/lock versions (including ranges) See `versionspec` in PyPA’s dependency specifiers (initially introduced in PEP 508).

validate_pyproject.formats.pep517_backend_reference(value: str) → bool

  See PyPA’s specification for defining build-backend references introduced in PEP 517#source-trees.

  This is similar to an entry-point reference (e.g., `package.module:object`).

validate_pyproject.formats.pep561_stub_name(value: str) → bool

  Name of a directory containing type stubs. It must follow the name scheme `<package>-stubs` as defined in PEP 561#stub-only-packages.

validate_pyproject.formats.python_entrypoint_group(value: str) → bool

  See `Data model > group` in the PyPA’s entry-points specification.

validate_pyproject.formats.python_entrypoint_name(value: str) → bool

  See `Data model > name` in the PyPA’s entry-points specification.

validate_pyproject.formats.python_entrypoint_reference(value: str) → bool

  Reference to a Python object using in the format:

      importable.module:object.attr

  See `Data model >object reference` in the PyPA’s entry-points specification.

validate_pyproject.formats.python_identifier(value: str) → bool

  Can be used as identifier in Python. (Validation uses `str.isidentifier`).

validate_pyproject.formats.python_module_name(value: str) → bool

  Module name that can be used in an `import`-statement in Python. See `python_qualified_identifier`.

validate_pyproject.formats.python_module_name_relaxed(value: str) → bool

  Similar to `python_module_name`, but relaxed to also accept dash characters (`-`) and cover special cases like `pip-run`.

  It is recommended, however, that beginners avoid dash characters, as they require advanced knowledge about Python internals.

  The following are disallowed:

  - names starting/ending in dashes,

  - names ending in `-stubs` (potentially collide with `pep561_stub_name`).

validate_pyproject.formats.python_qualified_identifier(value: str) → bool

  Python “dotted identifier”, i.e. a sequence of `python_identifier` concatenated with `"."` (e.g.: `package.module.submodule`).

validate_pyproject.formats.uint(value: int) → bool

  Unsigned 64-bit integer (\(0 \leq x < 2^{64}\))

validate_pyproject.formats.uint16(value: int) → bool

  Unsigned 16-bit integer (\(0 \leq x < 2^{16}\))

validate_pyproject.formats.uint8(value: int) → bool

  Unsigned 8-bit integer (\(0 \leq x < 2^8\))

validate_pyproject.formats.url(value: str) → bool

  Valid URL (validation uses `urllib.parse`). For maximum compatibility please make sure to include a `scheme` prefix in your URL (e.g. `http://`).