#low-level #libpostal #wrapper #thread-safe #initialization #locks #address

sys libpostal-sys

Low-level wrappers for libpostal address normalization (with locks to support thread-safe initialization)

3 releases

0.1.1 Feb 17, 2022
0.1.0 Feb 17, 2022

#172 in Geospatial

Download history 1475/week @ 2024-04-14 2266/week @ 2024-04-21 3283/week @ 2024-04-28 2970/week @ 2024-05-05 2180/week @ 2024-05-12 2341/week @ 2024-05-19 1915/week @ 2024-05-26 1363/week @ 2024-06-02 1107/week @ 2024-06-09 1248/week @ 2024-06-16 788/week @ 2024-06-23 459/week @ 2024-06-30 822/week @ 2024-07-07 625/week @ 2024-07-14 7/week @ 2024-07-21 17/week @ 2024-07-28

1,472 downloads per month
Used in 2 crates (via libpostal-rust)

Apache-2.0 OR MIT

40MB
609K SLoC

C 572K SLoC // 0.0% comments Python 15K SLoC // 0.1% comments Shell 8K SLoC // 0.2% comments M4 7.5K SLoC // 0.2% comments Rust 5K SLoC // 0.0% comments SQL 1K SLoC // 0.2% comments OCaml 203 SLoC Automake 85 SLoC // 0.1% comments

Contains (autotools obfuscated code, 475KB) libpostal/configure, (obscure autoconf code, 4KB) libpostal/configure.ac, (obscure autoconf code, 4KB) libpostal/windows/configure.ac

libpostal-sys

Low-level Rust bindings for the excellent address-parsing library libpostal. Several other Rust wrappers for this library exist. This one includes the following features, which may or may not be available elsewhere:

  • Bundled libpostal source code.
  • Support for building static Rust binaries.
  • Support for thread-safe initialization of libpostal, using provided global locks.
  • Packing as a low-level libpostal-sys crate that can be shared between one or more high-level crates, as per standard Rust conventions.
  • Support from cross-compiling from x86_64 Macs to aarch64 (Apple Silicon).

Development notes

# Check out libpostal source code as a git submodule.
git submodule update --init

# Update our Rust API bindings manually.
bindgen wrapper.h -o src/bindings.rs

Dependencies