Skip to main content

A comprehensive Python toolkit for IBAN validation, extraction, generation, formatting, parsing, and BIC lookup.

Project description

IBAN Tools 🏦

A comprehensive Python toolkit for IBAN operations including validation, extraction, generation, formatting, parsing, and BIC lookup.

Features (6 Core Functions)

Function Description
extract_ibans_from_text() Extract validated IBANs from any text
extract_ibans_from_pdf() Extract validated IBANs from PDF files
generate_mock_iban() Generate random but valid test IBANs
format_iban() / sanitize_iban() Format or clean IBAN strings
parse_iban() Decompose IBAN into structured components
iban_to_bic() Look up SWIFT BIC code from IBAN

Quick Start

from iban_tools import (
    validate_iban,
    extract_ibans_from_text,
    generate_mock_iban,
    format_iban,
    sanitize_iban,
    parse_iban,
    iban_to_bic,
)

# 1. Validate
validate_iban("DE89 3704 0044 0532 0130 00")  # True

# 2. Extract from text
text = "Transfer to DE89370400440532013000 or GB29NWBK60161331926819"
extract_ibans_from_text(text)
# ['DE89370400440532013000', 'GB29NWBK60161331926819']

# 3. Generate mock IBANs for testing
generate_mock_iban("TR")  # 'TR...' (valid random IBAN)

# 4. Format / Sanitize
format_iban("DE89370400440532013000")
# 'DE89 3704 0044 0532 0130 00'

sanitize_iban("DE89 3704-0044.0532/0130 00")
# 'DE89370400440532013000'

# 5. Parse
parse_iban("DE89370400440532013000")
# {
#   'is_valid': True,
#   'country_code': 'DE',
#   'check_digits': '89',
#   'bank_code': '37040044',
#   'account_number': '0532013000',
#   'bban': '370400440532013000',
#   'country_name': 'Germany'
# }

# 6. IBAN to BIC
iban_to_bic("DE89370400440532013000")  # 'COBADEFFXXX'

Installation

pip install iban-tools

Or from source:

git clone https://github.com/ademakdogan/iban-tools.git
cd iban-tools
uv sync --all-extras

Tech Stack

  • Python 3.13
  • uv package manager
  • pypdf (PDF extraction)
  • pytest (testing)

Supported Countries

BIC Lookup: AT, BE, DE, ES, FR, LU, NL

IBAN Validation & Generation: 76 countries (full ISO 13616 registry)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iban_tools-0.1.1.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iban_tools-0.1.1-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

Details for the file iban_tools-0.1.1.tar.gz.

File metadata

  • Download URL: iban_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for iban_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4babbbb3c4da4dbcb4512d19402540ab6faa49999897dd313decf570ac574452
MD5 71a2676866c9db6cc08d11190b6facaa
BLAKE2b-256 2727c51665c966f0fb2667b9362e42f8bb3205f567b0baebd43e026c57eab1f5

See more details on using hashes here.

File details

Details for the file iban_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iban_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for iban_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a9dfb0ade5b0eb44d7c71a11f39423a02fce06e06dad8ec3a095d9fd02d1831
MD5 2b6027c9969d5c4e1d60d97e4159390a
BLAKE2b-256 d24ff7d0d58f54267bc22f0b22e6f4d3c634d5c781a2313e30abccb7dd0dc685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page