RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

PicoPhone: a fast native wrapper around libphonenumber

I just published pico_phone (source), a thin Ruby wrapper around Google’s libphonenumber C++ library via Rice. It’s the same engine Android’s dialer uses, so you get accurate parsing, validation, and formatting for phone numbers from any country: national/international/E.164 formats, area code and local number extraction, type detection (mobile, toll-free, etc.), vanity number conversion, short-number/emergency-number lookups, and more.

It all runs as compiled C++ instead of a pure-Ruby regex port, which matters if you’re validating numbers at any real volume. Pre-compiled native gems are available for arm64-darwin, x86_64-linux, and aarch64-linux, so most people can gem install pico_phone with no compiler or system libraries required. Feedback and issues welcome on GitHub.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in