Skip to content

Support Mailing Address Format Validation #74

@insightindustry

Description

@insightindustry

Given the localization themes of v.1.6.0, it may be helpful to support the automatic formatting of a single mailing address string given a componentized input. In other words:

  • validators.mailing_address(street_type = None, street_name = None, ..., country = None) with other mailing address components provided as optional keyword arguments. The returned result would be a single str with a properly-formatted mailing address for the country provided.
  • validators.mailing_address_components(value, country = None) which tries to parse a set of the components of a mailing address (e.g. street number, street name, city, etc.) from a single mailing address string and returns a dict with the relevant components parsed from value for country (if supplied, or from the first matching country if empty).
  • checkers.is_mailing_address(value, country = None) which tries to validate the string in value as a valid mailing address

In other words, the functions should be internally consistent: validators.mailing_address_components() should produce a set of keyword arguments which can then be passed to validators.mailing_address() to re-create the value passed to validators.mailing_address_components() in the first place.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions