https://github.com/yext/libphonenumber
golang port of Google's libphonenumber
https://github.com/yext/libphonenumber
Last synced: 5 months ago
JSON representation
golang port of Google's libphonenumber
- Host: GitHub
- URL: https://github.com/yext/libphonenumber
- Owner: yext
- License: mit
- Fork: true (ttacon/libphonenumber)
- Created: 2016-08-25T22:08:18.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T22:40:46.000Z (over 1 year ago)
- Last Synced: 2025-03-01T00:35:05.599Z (over 1 year ago)
- Language: Go
- Size: 672 KB
- Stars: 0
- Watchers: 14
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
libphonenumber
==============
golang port of Google's libphonenumber
[](http://forthebadge.com)
[](https://travis-ci.org/ttacon/libphonenumber)
WARNING
=======
There is currently a lot going on, I started this a while ago and
recently picked it back up and got it functional. It was initially
translated from the Java version of libphonenumber, but I wasn't a
fan of always relying on loading proto files that were encoded in
ObjectStreams (so all metadata is embedded in the code, and I'm
exploring better ways to do this).
Pull requests are of course welcome, but things will be moving fast
at first so they may not be accepted until I get this repo to a more
stable state - currently it is VERY fragile.
I should get it cleaned up soon (think a few days) in which case
I would love for help finishing this off :).
Examples
========
Super simple to use.
### To get a phone number
```go
num, err := libphonenumber.Parse("6502530000", "US")
```
### To format a number
```go
// num is a *libphonenumber.PhoneNumber
formattedNum := libphonenumber.Format(num, libphonenumber.NATIONAL)
```