Skip to content

Package postal provides Go bindings for libpostal, a C library for fast international street address parsing and normalization.

Notifications You must be signed in to change notification settings

zenhotels/libpostal-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libpostal-go

The package provides Go bindings for libpostal, a C library for fast international street address parsing and normalization.
All the binding code has automatically been generated with rules defined in postal.yml.

Usage

$ go get github.com/zenhotels/libpostal-go/postal

Demo

There is an example parser command line utility. You will need to setup your libpostal first, follow the installation instructions in the official distribution.

$ pkg-config --libs libpostal
-L/usr/local/lib -lpostal

$ go get github.com/zenhotels/libpostal-go/cmd/postal-parser

$ postal-parser Champ de Mars, 5 Avenue Anatole France, 75007 Paris, France
main.go:40: address components: 6
main.go:52:
╭──────────────────────────────────────╮
│           libpostal parse            │
├──────────────┬───────────────────────┤
│ road         │ champ de mars         │
│ house_number │ 5                     │
│ road         │ avenue anatole france │
│ postcode     │ 75007                 │
│ city         │ paris                 │
│ country      │ france                │
╰──────────────┴───────────────────────╯

Rebuilding the package

You will need to get the cgogen tool installed first.

$ git clone https://github.com/zenhotels/libpostal-go && cd libpostal-go
$ make clean
$ make

About

Package postal provides Go bindings for libpostal, a C library for fast international street address parsing and normalization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages