Code Monkey home page Code Monkey logo

dialrs's Introduction

dialrs

R-CMD-check CRAN status

dialrs is an experimental R package to parse phone numbers using the Rust crate phonenumber.

Installation

You can install the development version of dialrs like so:

remotes::install_github("schochastics/dialrs")
pak::pak("schochastics/dialrs")

Example

library(dialrs)
numbers <- c("+1 202-555-0173", "+33 122 334 455", "+1 1 800 FLOWERS")
phone_is_valid(numbers)
#> [1]  TRUE  TRUE FALSE
phone_type(numbers)
#> [1] "fixed_line_or_mobile" "fixed_line"           "unknown"
phone_country_code(numbers)
#> [1]  1 33  1
phone_parse(numbers, format = "International")
#> [1] "+1 202-555-0173"   "+33 1 22 33 44 55" "+1 18003569377"
phone_parse(numbers, format = "National")
#> [1] "(202) 555-0173" "01 22 33 44 55" "18003569377"
phone_parse(numbers, format = "RFC3966")
#> [1] "tel:+1-202-555-0173"   "tel:+33-1-22-33-44-55" "tel:+1-18003569377"
phone_parse(numbers, format = "E.164")
#> [1] "+12025550173"  "+33122334455"  "+118003569377"

Note

There is already an R package for that, called dialr, which wraps Google’s libphonenumber Java library.

dialrs's People

Contributors

schochastics avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.