REST API for libpostal.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Justin Duch 332b15b75c Merge branch 'master' of ssh://git.duch.me:222/justin/libpostal-rest 6 months ago
.gitignore add files 8 months ago
Dockerfile add files 8 months ago
LICENSE Initial commit 8 months ago
Makefile add files 8 months ago
README.md add files 8 months ago
go.mod add files 8 months ago
go.sum add files 8 months ago
main.go fix defer not called 6 months ago

README.md

libpostal-rest

REST API for libpostal.

Note: Training data (~2GB) is included in the Docker image.

Development/Setup

Requirements:

REST server defaults to port 8080:

go run main.go

Examples

Formatted by jq.

Parser

➜ curl -X POST -d '{"query": "30 place des saisons, 92400 courbevoie france"}' localhost:8080/parser | jq
[
  {
    "label": "house_number",
    "value": "30"
  },
  {
    "label": "road",
    "value": "place des saisons"
  },
  {
    "label": "postcode",
    "value": "92400"
  },
  {
    "label": "city",
    "value": "courbevoie"
  },
  {
    "label": "country",
    "value": "france"
  }
]

Expand

➜ curl -X POST -d '{"query": "deux cent onze ave jean jaurès"}' localhost:8080/expand | jq
[
  "211 avenue jean jaures"
]