Skip to content

normalize_ppu

cl_forge.verify.normalize_ppu

normalize_ppu(ppu: str) -> str

Normalizes a given PPU string to a standard format.

If the format is recognized as LLLNN (3 letters followed by 2 digits), the function prepends a '0' after the first 3 characters, resulting in a normalized format of LLL0NN. Otherwise, the ppu is returned as-is, but trimmed in uppercase.

Parameters:

Name Type Description Default
ppu Chilean PPU (vehicle license plate).
required

Returns:

Type Description
str

Normalized PPU.

Source code in src/cl_forge/core/impl/rs_cl_forge/rs_verify.pyi
def normalize_ppu(ppu: str) -> str:
    """
    Normalizes a given PPU string to a standard format.

    If the format is recognized as `LLLNN` (3 letters followed by 2 digits),
    the function prepends a '0' after the first 3 characters, resulting in a
    normalized format of `LLL0NN`. Otherwise, the `ppu` is returned as-is, but
    trimmed in uppercase.

    Parameters
    ----------
    ppu : Chilean PPU (vehicle license plate).

    Returns
    -------
    str
        Normalized PPU.
    """