• Stars
    star
    616
  • Rank 72,837 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

golang port of Google's libphonenumber

libphonenumber

golang port of Google's libphonenumber

forthebadge

Build Status GoDoc

Status

This library is fully stable and is used in production by several companies.

Examples

Super simple to use.

To get a phone number

num, err := libphonenumber.Parse("6502530000", "US")

To format a number

// num is a *libphonenumber.PhoneNumber
formattedNum := libphonenumber.Format(num, libphonenumber.NATIONAL)

To get the area code of a number

// Parse the number.
num, err := libphonenumber.Parse("1234567890", "US")
if err != nil {
        // Handle error appropriately.
}

// Get the cleaned number and the length of the area code.
natSigNumber := libphonenumber.GetNationalSignificantNumber(num)
geoCodeLength := libphonenumber.GetLengthOfGeographicalAreaCode(num)

// Extract the area code.
areaCode := ""
if geoCodeLength > 0 {
        areaCode = natSigNumber[0:geoCodeLength]
}
fmt.Println(areaCode)

More Repositories

1

chalk

Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk
Go
429
star
2

box

golang API for box
Go
17
star
3

emoji

emoji for golang
Go
10
star
4

go-utils

a collection of utilities that I find usefull
Go
8
star
5

glorious

Go
7
star
6

uri

RFC 3986 compliant uri builder/parser
Go
5
star
7

mixmax-api

Cheeky wrapper around the Mixmax API
JavaScript
4
star
8

tesseract

an pure Go implementation of tesseract
C++
4
star
9

rpp

Go
3
star
10

builder

what it says
Go
3
star
11

combee

testing shell for bee-queue
JavaScript
3
star
12

godef

Fork from code.google.com/p/rog-go/exp/cmd/godef
Go
3
star
13

simplehttpserver

An idiomatic go version of "python -m SimpleHTTPServer", also less verbose to type
Go
2
star
14

jiraquery

Go
2
star
15

pouch

ORMs done fun
Go
2
star
16

awesome-virtual-conferences

2
star
17

toml2cli

Because writing CLI boilerplate is boring
Go
2
star
18

whodo

a tool for seeing who has left what todos in your go code
Go
2
star
19

sentry-assign

Simple service for auto-assigning users to projects in Sentry
Go
2
star
20

gobi

Go
2
star
21

spf-tree

Shows the SPF lookups for a mail host as a tree
Go
2
star
22

synchronize-fiber-count

counting fibers
JavaScript
2
star
23

autumn

Because setting up a new service should be easy.
Go
1
star
24

twine

Go
1
star
25

qatch

Slow query catcher
JavaScript
1
star
26

dote

Go
1
star
27

synthd

TypeScript
1
star
28

scrap-yard

Collection of tools and code thrown together to answer questions
Go
1
star
29

requests

Easy request building library
Go
1
star
30

gemini

Go
1
star
31

instagram

golang client for instagram
Go
1
star
32

minfo

Go
1
star
33

fs

Go
1
star
34

gile

Simple jQuery plugin for creating custom styled form file elements with CSS.
JavaScript
1
star
35

terraform-sentry-project

An opinionated take on how to structure Sentry projects in terraform
Go
1
star
36

pipes

utility package for piping shell commands
Go
1
star
37

sqlgen

yolo...
1
star
38

horhur

Go
1
star
39

beautiful-goop

beautiful soup for go
Go
1
star
40

stash

go stash client
Go
1
star
41

synthd-bin

synthd CLI utility
TypeScript
1
star
42

gofourit

Ensure singleton execution of cron jobs across a distributed system.
Go
1
star
43

terraform-malicious-null-resource

HCL
1
star