How openvenues/libpostal works
libpostal is a C library for international address parsing and normalization, with Python geodata tooling that supports data preparation and related geographic NLP tasks. The visible CLI accepts an address, initializes the library, requests expansions, and prints them. The README documents parsing and normalization as the product purpose; internal parser/model links and most data-preparation flows are not shown in the excerpts, so those relationships are marked unverified rather than asserted.
Main entry points: address_parser.c Address parser · libpostal.c Public library API · expand.c Address expansion · averaged_perceptron_tagger.c Perceptron tagger
Components 20
Entry points
- CLI interface
src/main.c - Public library API
src/libpostal.c
Address processing
- Address parser
src/address_parser.c - Address expansion
src/expand.c - Address dictionaries
scripts/geodata/address_expansions/address_dictionaries.py - Address formatting
scripts/geodata/address_formatting/formatter.py
Language and text
- Text normalization
scripts/geodata/text/normalize.py - Unicode processing
src/utf8proc/utf8proc.c - Transliteration
src/transliterate.c - Language classifier
src/language_classifier.c
Statistical models
- Perceptron tagger
src/averaged_perceptron_tagger.c - Perceptron model
src/averaged_perceptron.c - CRF model
src/crf.c
Geodata tooling
- Address configuration
scripts/geodata/addresses/config.py - Gazetteers
scripts/geodata/address_expansions/gazetteers.py - OpenStreetMap data tools
scripts/geodata/osm/formatter.py - OpenAddresses tools
scripts/geodata/openaddresses/formatter.py - GeoNames data tools
scripts/geodata/geonames/create_geonames_tsv.py - Who’s On First tools
scripts/geodata/whosonfirst/client.py
Other components
- Application user
Connections 19
- Application user → CLI interface: provides address
src/main.c - CLI interface → Public library API: requests expansions
src/main.c - Public library API → Address parser: parses address
- Public library API → Address expansion: expands address
- Address parser → Perceptron tagger: uses tagging
- Perceptron tagger → Perceptron model: uses model
- Perceptron tagger → CRF model: uses model
- Address parser → Text normalization: normalizes text
- Text normalization → Unicode processing: uses Unicode
- Address parser → Language classifier: identifies language
- Address expansion → Address dictionaries: uses dictionaries
- Address expansion → Transliteration: transliterates text
- Address formatting → Text normalization: normalizes text
- Gazetteers → Address dictionaries: loads dictionaries
scripts/geodata/address_expansions/gazetteers.py - Address configuration → Address dictionaries: references dictionaries
scripts/geodata/addresses/config.py - OpenStreetMap data tools → Address configuration: uses configuration
- OpenAddresses tools → Address configuration: uses configuration
- GeoNames data tools → Gazetteers: prepares geographic data
- Who’s On First tools → Gazetteers: supports geographic data