Package: addressValidator
addressValidatorValidate urban and rural addresses in ColombiaExplore the docs»Report Bug·Request FeatureTable of ContentsAbout The ProjectDocumentationGetting StartedInstallationUsagefunctionsaddress_validatoraddress_validator_dianaddress_validator_fileaddress_validator_file_dianRoadmapContributingLicenseAbout The Projectthe project was developed through the definition of Mealy machines, regular expressions, regular grammars, Automata, for the validation of all addresses currently valid in Colombia.the standardization ofurban addresses of the ministry of educationwas used as a guideline.DocumentationGetting StartedInstallationpipinstalladdressValidator

or

py-mpipinstalladdressValidatorlatest stable versionaddressValidator==1.2.1UsageExamplefromaddressValidatorimportaddress_validatoraddress="Calle 3BC #10-2 Barrio San Juan Apartamento 201"ifaddress_validator(address):print(address+" direccion valida")else:print(address+" direccion invalida")For more examples, please refer to theExamples packagesFunctionswe can use 4 functions to validate both urban and rural addressesaddress_validatoraddress_validator function receives as a parameter a mandatory string which will be evaluated and will return a boolean if valid or not.fromaddressValidatorimportaddress_validator# address_validator(str) -> booladdress=address_validator("Calle 13B #10-3")print(address)//#Trueif the address is not valid it will return FalsefromaddressValidatorimportaddress_validator# address_validator(str) -> booladdress=address_validator("Calle 13sur 13-121B")print(address)//#Falseaddress_validator_dianfucntion address_validator_dian returns the address validation according todian nomenclaturefromaddressValidatorimportaddress_validator_dian# address_validator_dian(str) -> booladdress=address_validator_dian("Cl 13 B 10 3")print(address)//#Trueif the address is not valid it will return FalsefromaddressValidatorimportaddress_validator_dian# address_validator_dian(str) -> booladdress=address_validator_dian("Cl 13 sur 13 121 B")print(address)//#Falseaddress_validator_fileaddress_validator_file function receives a text file, does not return any value, this function creates a text file with the respective validations.fromaddressValidatorimportaddress_validator_file# address_validator_file(file) -> Nonewithopen("address.txt")asfile_object:address_validator_file(file_object)# create output.txthere we can see that we read a file calledaddress.txtthat we find in the examples folder this function will return the validations of all the strings as we can see in theoutput.txtfile.All this for urban and rural addressesaddress_validator_file_dianThe function address_validator_file_dian receives a text file, creates a text file with the validations of the addresses with dian nomenclaturefromaddressValidatorimportaddress_validator_file_dian# address_validator_file_dian(file) -> Nonewithopen("addressDian.txt")asfile_object:address_validator_file_dian(file_object)# create output.txtWe read theaddressDianfile from the root path and send the document to the function and it returns the validations in anoutput.txtfile. Validations with file for dian nomenclature is in theoutput_dian.txtfileRoadmapSee theopen issuesfor a list of proposed features (and known issues).ContributingContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make aregreatly appreciated.Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull RequestLicenseDistributed under the MIT License. SeeLICENSEfor more information.