{"id":20550227,"url":"https://github.com/dnmfarrell/geo-libpostal","last_synced_at":"2025-08-01T11:11:36.217Z","repository":{"id":56837951,"uuid":"63124400","full_name":"dnmfarrell/Geo-libpostal","owner":"dnmfarrell","description":"Perl bindings for libpostal","archived":false,"fork":false,"pushed_at":"2021-06-16T13:38:00.000Z","size":68,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T00:24:34.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnmfarrell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-12T03:48:10.000Z","updated_at":"2021-06-15T19:17:25.000Z","dependencies_parsed_at":"2022-09-12T10:20:10.567Z","dependency_job_id":null,"html_url":"https://github.com/dnmfarrell/Geo-libpostal","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FGeo-libpostal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FGeo-libpostal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FGeo-libpostal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FGeo-libpostal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnmfarrell","download_url":"https://codeload.github.com/dnmfarrell/Geo-libpostal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868767,"owners_count":21174758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T02:23:55.935Z","updated_at":"2025-04-14T11:17:27.517Z","avatar_url":"https://github.com/dnmfarrell.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nGeo::libpostal - Perl bindings for libpostal\n\n# SYNOPSIS\n\n    use Geo::libpostal ':all';\n\n    # normalize an address\n    my @addresses = expand_address('120 E 96th St New York');\n\n    # parse addresses into their components\n    my %address = parse_address('The Book Club 100-106 Leonard St Shoreditch London EC2A 4RH, United Kingdom');\n\n    # %address contains:\n    # (\n    #   road         =\u003e 'leonard st',\n    #   postcode     =\u003e 'ec2a 4rh',\n    #   house        =\u003e 'the book club',\n    #   house_number =\u003e '100-106',\n    #   suburb       =\u003e 'shoreditch',\n    #   country      =\u003e 'united kingdom',\n    #   city         =\u003e 'london'\n    # );\n\n# DESCRIPTION\n\nlibpostal is a C library for parsing/normalizing international street addresses. Address strings can be normalized using `expand_address` which returns a list of valid variations so you can check for duplicates in your dataset. It supports normalization in over [60 languages](https://github.com/openvenues/libpostal/tree/master/resources/dictionaries). An address string can also be parsed into its constituent parts using `parse_address` such as house name, number, city and postcode.\n\n# FUNCTIONS\n\n## expand\\_address\n\n    use Geo::libpostal 'expand_address';\n\n    my @ny_addresses = expand_address('120 E 96th St New York');\n    my @fr_addresses = expand_address('Quatre vingt douze R. de l\\'Église');\n\nTakes an address string and returns a list of known variants. Useful for normalization. Accepts many boolean options:\n\n    expand_address('120 E 96th St New York',\n        latin_ascii =\u003e 1,\n        transliterate =\u003e 1,\n        strip_accents =\u003e 1,\n        decompose =\u003e 1,\n        lowercase =\u003e 1,\n        trim_string =\u003e 1,\n        drop_parentheticals =\u003e 1,\n        replace_numeric_hyphens =\u003e 1,\n        delete_numeric_hyphens =\u003e 1,\n        split_alpha_from_numeric =\u003e 1,\n        replace_word_hyphens =\u003e 1,\n        delete_word_hyphens =\u003e 1,\n        delete_final_periods =\u003e 1,\n        delete_acronym_periods =\u003e 1,\n        drop_english_possessives =\u003e 1,\n        delete_apostrophes =\u003e 1,\n        expand_numex =\u003e 1,\n        roman_numerals =\u003e 1,\n    );\n\n**Warning**: old versions of libpostal [segfault](https://github.com/openvenues/libpostal/issues/79) if all options are set to false. `Geo::libpostal` includes a unit test for this.\n\nAlso accepts an arrayref of language codes per [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes):\n\n    expand_address('120 E 96th St New York', languages =\u003e [qw(en fr)]);\n\nThis is useful if you are normalizing addresses in multiple languages.\n\nFinally `expand_address` accepts an option for which address `components` to expand. This is a 16 bit integer bitmask. These constants are exported with the `:all` tag:\n\n    $ADDRESS_NONE\n    $ADDRESS_ANY\n    $ADDRESS_NAME\n    $ADDRESS_HOUSE_NUMBER\n    $ADDRESS_STREET\n    $ADDRESS_UNIT\n    $ADDRESS_LOCALITY\n    $ADDRESS_ADMIN1\n    $ADDRESS_ADMIN2\n    $ADDRESS_ADMIN3\n    $ADDRESS_ADMIN4\n    $ADDRESS_ADMIN_OTHER\n    $ADDRESS_COUNTRY\n    $ADDRESS_POSTAL_CODE\n    $ADDRESS_NEIGHBORHOOD\n    $ADDRESS_ALL\n\nThese are the default components used by libpostal:\n\n    use Geo::libpostal ':all';\n\n    expand_address('120 E 96th St New York',\n      components =\u003e $ADDRESS_NAME | $ADDRESS_HOUSE_NUMBER | $ADDRESS_STREET | $ADDRESS_UNIT\n    );\n\nThe constant `$ADDRESS_ALL` uses all components:\n\n    expand_address('120 E 96th St New York',\n      components =\u003e $ADDRESS_ALL\n    );\n\n`expand_address` will `die` on `undef` and empty addresses, odd numbers of options and unrecognized options. Exported on request.\n\n## parse\\_address\n\n    use Geo::libpostal 'parse_address';\n\n    my %ny_address = parse_address('120 E 96th St New York');\n    my %fr_address = parse_address('Quatre vingt douze R. de l\\'Église');\n\nWill `die` on `undef` and empty addresses. Exported on request.\n\n`parse_address` may return [duplicate labels](https://github.com/openvenues/libpostal/issues/27) for invalid addresses\nstrings.\n\n# WARNING\n\nlibpostal uses `setup` and `teardown` functions. Setup is lazily loaded. Teardown occurs in an `END` block automatically.\n\n- Old versions of libpostal `Geo::libpostal` will [segfault](https://github.com/openvenues/libpostal/issues/82) if `_teardown()` is called twice (this module includes a unit test for this).\n- If `expand_address` or `parse_address` is called after teardown, old versions of libpostal will [error](https://github.com/openvenues/libpostal/pull/86) (this module includes a unit test for this too).\n- libpostal is not [thread-safe](https://github.com/openvenues/libpostal/issues/34).\n\n# EXTERNAL DEPENDENCIES\n\n[libpostal](https://github.com/openvenues/libpostal) is required. This has been tested against [v1.0.0](https://github.com/openvenues/libpostal/releases/tag/v1.0.0).\n\n# INSTALLATION\n\nYou can install this module with CPAN:\n\n    $ cpan Geo::libpostal\n\nOr clone it from GitHub and install it manually:\n\n    $ git clone https://github.com/dnmfarrell/Geo-libpostal\n    $ cd Geo-libpostal\n    $ perl Makefile.PL\n    $ make\n    $ make test\n    $ make install\n\n# AUTHOR\n\n© 2021 David Farrell\n\n# LICENSE\n\nSee LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fgeo-libpostal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnmfarrell%2Fgeo-libpostal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fgeo-libpostal/lists"}