- Notifications
You must be signed in to change notification settings - Fork26
🍴 A toolkit for manipulating, validating and testing IP addresses and ranges, along with datasets relating to IP addresses. While it primarily has support for the IPv4 address space, more extensive IPv6 support is intended.
License
hrbrmstr/iptools
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
iptools
is a set of tools for working with IP addresses. The aim is toprovide functionality not presently available with any existing Rpackage and to do so with as much speed as possible. To that end, manyof the operations are written inRcpp
and require installation of theAsioHeaders
package. A current, lofty goal is to mimic most of thefunctionality of the Pythoniptools
module and make IP addresses firstclass R objects.
Availableon CRAN
Thanks to @eddelbuettel we’ve thinned down this version ofiptools
andit should also work on Windows now!
The package primarily supports IPv4 addresses due to deficiencies in R’ssupport for large numbers, but there is IPv6 support for somefunctionality, and we plan to build more in as R improves and as we do.Functionality includes:
- Converting IP addresses to their numeric form, and then back tostrings, with
ip_to_numeric
andnumeric_to_ip
; - Validating and classifying IP addresses with
ip_classify
; - Range generation and checking with
range_boundaries
,range_generate
andvalidate_range
,country_ranges
, and; - Several inbuilt IP-related datasets.
For more information, see the vignettes onthefunctionalityandthedatasetswithiniptools
.
To install the development version:
devtools::install_github("hrbrmstr/iptools")# orinstall.packages("iptools")
iptools
depends on theAsioHeaders package whichis now in CRAN.
library(iptools)library(testthat)date()#> [1] "Sun Oct 14 11:29:55 2018"test_dir("tests/")#> ✔ | OK F W S | Context#> ══ testthat results ══════════════════════════════════════════════════════#> OK: 82 SKIPPED: 0 FAILED: 0#>#> ══ Results ════════════════════════════════════════════════════════════════#> Duration: 0.4 s#>#> OK: 0#> Failed: 0#> Warnings: 0#> Skipped: 0
Lang | # Files | (%) | LoC | (%) | Blank lines | (%) | # Lines | (%) |
---|---|---|---|---|---|---|---|---|
C++ | 4 | 0.13 | 846 | 0.52 | 167 | 0.38 | 375 | 0.28 |
R | 20 | 0.67 | 444 | 0.27 | 133 | 0.31 | 638 | 0.47 |
HTML | 2 | 0.07 | 228 | 0.14 | 47 | 0.11 | 2 | 0.00 |
Rmd | 3 | 0.10 | 60 | 0.04 | 57 | 0.13 | 109 | 0.08 |
C/C++ Header | 1 | 0.03 | 37 | 0.02 | 30 | 0.07 | 223 | 0.17 |
Please note that this project is released with aContributor Code ofConduct. By participating in this project you agree toabide by its terms.
About
🍴 A toolkit for manipulating, validating and testing IP addresses and ranges, along with datasets relating to IP addresses. While it primarily has support for the IPv4 address space, more extensive IPv6 support is intended.