Validation and Normalization of Financial Identifiers

Validate and normalize identifiers that are ubiquitous in financial technology data pipelines: payment card numbers (Luhn), International Bank Account Numbers (IBAN, ISO 13616), International Securities Identification Numbers (ISIN, ISO 6166), CUSIP, SEDOL, Legal Entity Identifiers (LEI, ISO 17442), Financial Instrument Global Identifiers (FIGI), SWIFT/BIC codes (ISO 9362) and Chinese Unified Social Credit Codes (GB 32100-2015). All checks run offline with base R only.


finid

Validation and normalization of financial identifiers for R.

finid checks identifiers offline, with no third-party dependencies, and returns vectorized results that fit naturally into data-cleaning pipelines.

Identifiers

Type Function Standard
Payment card numbers pan_valid(), luhn_valid(), luhn_check_digit() Luhn
IBAN iban_valid(), iban_format() ISO 13616
ISIN isin_valid(), isin_country(), isin_check_digit() ISO 6166
CUSIP cusip_valid(), cusip_check_digit() -
SEDOL sedol_valid(), sedol_check_digit() -
LEI lei_valid(), lei_check_digits() ISO 17442
FIGI figi_valid(), figi_check_digit() OMG FIGI
SWIFT/BIC swift_valid(), swift_country() ISO 9362
Unified Social Credit Code uscc_valid(), uscc_check_digit() GB 32100-2015

Installation

# once released on CRAN
install.packages("finid")

# or from source
install.packages("finid_0.1.0.tar.gz", repos = NULL, type = "source")

Quick start

library(finid)

finid_normalize("gb82 west 1234 5698 7654 32")
#> [1] "GB82WEST12345698765432"

finid_check(c(
  "US0378331005",
  "GB82WEST12345698765432",
  "037833100",
  "4532015112830366",
  "not-an-id"
))
#>                 input             normalized  type valid
#> 1         US0378331005          US0378331005  isin  TRUE
#> 2 GB82WEST12345698765432 GB82WEST12345698765432  iban  TRUE
#> 3           037833100            037833100 cusip  TRUE
#> 4      4532015112830366      4532015112830366   pan  TRUE
#> 5         not-an-id             NOT-AN-ID unknown FALSE

Identifiers can be supplied with spaces or hyphens; every validator normalizes its input first.

License

MIT (see LICENSE).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("finid")

0.1.1 by Shengxin Hao, 11 hours ago


Browse source code at https://github.com/cran/finid


Authors: Shengxin Hao [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests knitr, rmarkdown, testthat


See at CRAN