HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/faker/providers/barcode/en_CA/__init__.py
from itertools import product

from ..en_US import Provider as EnUsBarcodeProvider


class Provider(EnUsBarcodeProvider):
    """Implement barcode provider for ``en_CA`` locale.

    Canada uses UPC as well, so there are similarities between this and the
    ``en_US`` implementation.

    Sources:

    - https://gs1.org/standards/id-keys/company-prefix
    - https://www.nationwidebarcode.com/upc-country-codes/
    """

    local_prefixes = (
        # Some sources do not specify prefixes 00~01, 06~09 for use in Canada,
        # but it's referenced in other pages
        *product((0,), range(2)),
        *product((0,), range(6, 10)),
        (7, 5),
    )