How to use the zipcodes.is_real function in zipcodes

To help you get started, we’ve selected a few zipcodes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github seanpianka / Zipcodes / tests / __init__.py View on Github external
                lambda: zipcodes.is_real("06905"),
                lambda: zipcodes._contains_nondigits("1234a"),
github seanpianka / Zipcodes / tests / __init__.py View on Github external
                lambda: zipcodes.is_real("91239"),
                # digits and "-" are acceptable
github OperationCode / operationcode-pybot / pybot / endpoints / slack / utils / slash_lunch.py View on Github external
def _get_zipcode(cls, zipcode: str) -> int:
        try:

            if is_real(zipcode):
                return int(zipcode)
        except TypeError:
            pass

        return cls._random_zip()
github OperationCode / operationcode-pybot / pybot / endpoints / slack / utils / slash_lunch.py View on Github external
def _random_zip() -> int:
        """
        Because what doesn't matter is close food but good food
        :return: zip_code
        :rtype: str
        """
        random_zip = 0
        while not is_real(str(random_zip)):
            range_start = 10 ** 4
            range_end = (10 ** 5) - 1
            random_zip = randint(range_start, range_end)

        return random_zip

zipcodes

Query U.S. state zipcodes without SQLite.

MIT
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis

Similar packages