{"id":19076057,"url":"https://github.com/openvenues/jpostal","last_synced_at":"2025-08-22T03:32:24.612Z","repository":{"id":147920994,"uuid":"52108686","full_name":"openvenues/jpostal","owner":"openvenues","description":"Java/JNI bindings to libpostal for for fast international street address parsing/normalization","archived":false,"fork":false,"pushed_at":"2025-05-16T20:37:12.000Z","size":155,"stargazers_count":119,"open_issues_count":12,"forks_count":45,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-01T14:01:27.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openvenues.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-19T18:44:20.000Z","updated_at":"2025-05-28T15:32:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"4747cba8-9929-45c9-ac87-da460468b93c","html_url":"https://github.com/openvenues/jpostal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openvenues/jpostal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fjpostal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fjpostal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fjpostal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fjpostal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openvenues","download_url":"https://codeload.github.com/openvenues/jpostal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fjpostal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271579433,"owners_count":24784250,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09T01:56:53.981Z","updated_at":"2025-08-22T03:32:24.607Z","avatar_url":"https://github.com/openvenues.png","language":"Java","funding_links":[],"categories":["Geospatial Library","Java","人工智能"],"sub_categories":["Java"],"readme":"jpostal\n-------\n\n[![Build Status](https://travis-ci.org/openvenues/jpostal.svg?branch=master)](https://travis-ci.org/openvenues/jpostal)\n\nThese are the Java/JNI bindings to [libpostal](https://github.com/openvenues/libpostal), a fast, multilingual NLP library (written in C) for parsing/normalizing physical addresses around the world.\n\nUsage\n-----\n\nTo expand address strings into normalized forms suitable for geocoder queries:\n\n```java\nimport com.mapzen.jpostal.AddressExpander;\n\n// Singleton, libpostal setup is done in the constructor\nAddressExpander e = AddressExpander.getInstance();\nString[] expansions = e.expandAddress(\"Quatre vingt douze Ave des Champs-Élysées\");\n```\n\nTo parse addresses into components:\n\n```java\nimport com.mapzen.jpostal.AddressParser;\n\n// Singleton, parser setup is done in the constructor\nAddressParser p = AddressParser.getInstance();\nParsedComponent[] components = p.parseAddress(\"The Book Club 100-106 Leonard St, Shoreditch, London, Greater London, EC2A 4RH, United Kingdom\");\n\nfor (ParsedComponent c : components) {\n    System.out.printf(\"%s: %s\\n\", c.getLabel(), c.getValue());\n}\n```\n\nTo use a libpostal installation with a datadir known at setup-time:\n\n```java\n\nimport com.mapzen.jpostal.AddressParser;\nimport com.mapzen.jpostal.AddressExpander;\n\nAddressExpander e = AddressExpander.getInstanceDataDir(\"/some/path\");\nAddressParser p = AddressParser.getInstanceDataDir(\"/some/path\");\n```\n\nBuilding libpostal\n------------------\n\nBefore building the Java bindings, you must install the libpostal C library. Make sure you have the following prerequisites:\n\n**On Ubuntu/Debian**\n```\nsudo apt-get install curl autoconf automake libtool pkg-config\n```\n\n**On CentOS/RHEL**\n```\nsudo yum install curl autoconf automake libtool pkgconfig\n```\n\n**On Mac OSX**\n```\nbrew install curl autoconf automake libtool pkg-config\n```\n\n**Installing libpostal**\n\n```shell\ngit clone https://github.com/openvenues/libpostal\ncd libpostal\n./bootstrap.sh\n./configure --datadir=[...some dir with a few GB of space...]\n\nmake\nsudo make install\n\n# On Linux it's probably a good idea to run\nsudo ldconfig\n```\n\nNote: libpostal \u003e= v0.3.3 is required to use this binding.\n\n\nBuilding jpostal\n----------------\n\nOnly one command is needed:\n\n```\n./gradlew assemble\n```\n\nThis will leverage gradle's NativeLibrarySpec support to build for the JNI/C portion of the library and installs the resulting shared libraries in the expected location for java.library.path\n\nUsage in a Java project\n-----------------------\n\nThe JNI portion of jpostal builds shared object files (.so on Linux, .jniLib on Mac) that need to be on java.library.path. \nAfter running ```gradle assemble``` the .so/.jniLib files can be found under ```./libs/jpostal/shared``` in the build dir. For running the tests, we set java.library.path explicitly [here](https://github.com/Qualytics/jpostal/blob/master/build.gradle#L63).\n\n\nCompatibility\n-------------\n\n-  Building jpostal is known to work on Linux and Mac OSX (including Mac silicon).\n-  Requires JDK 16 or later. Make sure JAVA_HOME points to JDK 16+. \n\n\nTests\n-----\n\nTo run the tests:\n\n```\n./gradlew check\n```\n\nLicense\n-------\n\nThe package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvenues%2Fjpostal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvenues%2Fjpostal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvenues%2Fjpostal/lists"}