A set of projects to facilitate validation of ibans and getting the bank identifier and branch identifier in Rust, Python and Polars.
The primary validation logic is written in Rust in the iban_validation_rs project. There is a Criterion benchmark to validate if changes are affecting performance positively. Two projects depend on it: the iban_validation_py, a Python wrapper using Maturin to compile, which is intended to be published in PyPI and conda (TODO). A small example in Python is included. The iban_validation_polars is a wrapper into a Polaris plugin, compiling through Maturin and intended to be published on Pypi and conda; likewise, a short example is provided.
The package is not a general-purpose library to parse IBANs. The intention is not for a user-facing library (in other words, for backends, not frontends). Hence, the 'print' format, loosely documented in the Iban Registry, is not implemented. Further, both the input and output of the library are intended to be in the 'electronic' format. BBAN (Basic Bank Account Number) validation only validates that the length, the position of the bank identifier, and the branch identifiers are correct. Further country-specific validations are not performed.
In contrast, the intention is to provide a quick, correct validation of the IBAN. Ideally, using minimal memory and CPU and reading the input only once. To integrate easily with other packages, it aims to keep dependencies low. A Python script pre-processed data for the library to decouple the main library and limit code change when a new version of the IBAN registry is released.
Some of the Makefile were inspired by the makefiles on the Polars project.
In the iban_validation_bench_rs, benchmark of similar crates published on crates.io is presented. While this library is the fastest other libraries can provide additional features that are more relevant to your use-cases. See details. Similar benchmarking was done on Python libraries see details.
While experimental the library can be tested as JS/WASM here: https://ericqu.github.io/iban_validation/
- 0.1.18: technical update updgraded to polars 0.49.1, pyo3 0.25, rust 1.88
- 0.1.17: memory usage reduced.
- 0.1.16: improved performance, added territories for GB and FR, and more tests, added WASM (experimental for now), added fuzzer.
- 0.1.15: improved performance (char to bytes) and improved c wrapper doc.
- 0.1.14: fixed error for country code IQ (using pdf instead of technical input file).
- 0.1.13: technical update to polars 0.48.1 and pyo3 0.24.
- 0.1.12: added the c/c++ wrapper.
- 0.1.11: eliminated rust dependecies (rust code generated from Python instead of Hash and Serde).
- 0.1.9: improve mod97 perf (reduce memory needed).
- 0.1.8: improve mod97 perf (cpu memory tradeoff).
- 0.1.7: improve performance related to the Iban structure again.
- 0.1.6: improve performance related to the Iban structure.
- 0.1.5: improve documentation and add support to Python 3.13.
- 0.1.4: technical update; updated polars dependency to polars 0.46.0, and py03 0.23 impacting only the Python packages.
- 0.1.3: Updated to latest Iban Register v99 from Dec 2024.