Skip to content

AeroXuk/LibPostalNet

 
 

Repository files navigation

LibPostalNet: A .Net Wrapper for libpostal

Build Status License

These are unofficial .Net bindings for libpostal, a fast statistical parser/normalizer for street addresses anywhere in the world.

Installation

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):

Usage

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());
            }
        }
    }
}

License

The software is available as open source under the terms of the MIT License.

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%