Skip to main content

bank-lint

Validate bank and account details offline — no API calls, no dependencies.

Supports IBAN (ISO 7064 mod-97, 89 countries) and US ABA routing numbers. UK sort codes are coming in a later release.

Part of a dual-language project: the same validation logic, verified against the same test vectors, is also available for JavaScript/TypeScript as bank-lint on npm.

Install

pip install bank-lint

Usage

from bank_lint import validate_iban, validate_us_routing

validate_iban("GB82 WEST 1234 5698 7654 32")
# ValidationResult(valid=True, value='GB82WEST12345698765432', error=None)

validate_us_routing("021000021")
# ValidationResult(valid=True, value='021000021', error=None)

Spaces and lower-case are handled for you; value is the normalised input.

API

validate_iban(value: str) -> ValidationResult

ISO 7064 mod-97 checksum plus per-country length.

validate_us_routing(value: str) -> ValidationResult

9-digit ABA routing number: prefix range + weighted checksum. Spaces and hyphens are stripped.

ValidationResult is a frozen dataclass:

valid: bool
value: str                    # normalised (spaces/hyphens removed)
error: str | None             # None when valid

error is one of:

  • "INVALID_FORMAT" — pattern or ABA prefix fails
  • "INVALID_LENGTH" — wrong length
  • "INVALID_CHECKSUM" — fails the checksum
  • "UNSUPPORTED_COUNTRY" — IBAN country code not in the registry

Scope

bank-lint checks the structural validity of a bank identifier — format, length, and checksum. It does not:

  • confirm the account actually exists or is open,
  • do name matching or Confirmation of Payee,
  • look up bank or branch details.

Country IBAN lengths are sourced from the official SWIFT IBAN Registry.

License

PolyForm Noncommercial 1.0.0. Personal, research, and nonprofit use is allowed. Commercial use needs a separate license from the author.

Metadata

Release files for bank-lint 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bank-lint 0.2.1
File Size Uploaded Provenance
bank_lint-0.2.1.tar.gz 3.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bank-lint 0.2.1
File Interpreter ABI Platform
bank_lint-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / bank_lint-0.2.1.tar.gz

Download URL bank_lint-0.2.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
499f1330acb8bfff669d8c896379185d8b1430d9d05ecce703ac9918875b4ec9
BLAKE2b-256 checksum
How to use checksums
772108eb62ae39008a4f7e28c7a8355f63a1e5ef039388d9893c0fc5c04ce0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / bank_lint-0.2.1-py3-none-any.whl

Download URL bank_lint-0.2.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac2824098c30d6641d360d543c214a27fa141ff69db8ed456bd30b4bb9803a2e
BLAKE2b-256 checksum
How to use checksums
9b58b5dfa34c4969f93a3e2586043f8e365151ccea1d0adaa817f2aef20fe4cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for bank-lint 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page