LibPostalNet: A .Net Wrapper for libpostal
These are unofficial .Net bindings for libpostal, a fast statistical parser/normalizer for street addresses anywhere in the world.
Before using the .Net bindings, you must build the libpostal C library or download the precompiled library. Build instructions can be found here: https://github.com/openvenues/libpostal#installation-windows
Downloads (From openvenues/libpostal AppVeyor CI):
using LibPostalNet;
using System;
namespace LibPostalConsole
{
class Program
{
static void Main(string[] args)
{
string address = "781 Franklin Ave Crown Heights Brooklyn NYC NY 11216 USA";
LibPostal libPostal = LibPostal.GetInstance();
var expansionOptions = libPostal.GetAddressExpansionDefaultOptions();
using (var expansion = libPostal.ExpandAddress(address, expansionOptions))
{
Console.WriteLine(expansion.ToJSON());
}
var parserOptions = libPostal.GetAddressParserDefaultOptions();
using (var response = libPostal.ParseAddress(address, parserOptions))
{
Console.WriteLine(response.ToJSON());
}
}
}
}
The software is available as open source under the terms of the MIT License.