Skip to main content

TON Address Converter

PyPI Downloads Python Versions OS Support

A Python library for bulk converting TON blockchain addresses between raw and user-friendly formats. Written in Rust with parallel processing capabilities, this library is particularly useful when working with large batches of addresses from block explorers or blockchain data.

Why This Library?

When working with TON blockchain data (especially when processing blocks), addresses typically come in raw format but need to be displayed in user-friendly format for end users. This library was created to:

  • Handle bulk address conversions efficiently
  • Provide parallel processing for large datasets
  • Maintain accuracy while optimizing performance
  • Offer a simple, Pythonic API

Performance

Our benchmarks show the following performance characteristics when compared to existing solutions:

Number of Addresses ton_address_converter pytoniq tonpy vs pytoniq vs tonpy
100 0.0018s 0.0006s 0.0001s 0.32x 0.07x
1,000 0.0092s 0.0055s 0.0011s 0.60x 0.12x
10,000 0.0202s 0.0601s 0.0110s 2.98x 0.55x
100,000 0.1569s 0.5455s 0.1164s 3.48x 0.74x

Benchmark Environment

  • intel i9 9900k
  • Python 3.12.3
  • pytoniq-core==0.1.40
  • tonsdk==1.0.15

Performance Analysis

  • For small batches (<1,000 addresses), tonpy and pytoniq perform better due to lower overhead
  • For larger batches (>10,000 addresses), ton_address_converter shows significant speedup:
    • Up to 3.48x faster than pytoniq
    • Competitive performance with tonpy
  • Best suited for bulk operations where parallel processing benefits can be realized

Installation

pip install ton_address_converter

Usage

from ton_address_converter import batch_convert_to_friendly, batch_convert_to_raw

# Convert raw addresses to user-friendly format
raw_addresses = [
    "0:73f17af370bd9d1f754be87a8a2d46f178aa72a9fc26f8ed9305977313f5dd29",
    # ... more addresses
]
friendly_addresses = batch_convert_to_friendly(
    raw_addresses,
    bounceable=True,    # Optional, default: False
    test_only=False,    # Optional, default: False
    url_safe=True,      # Optional, default: True
    chunk_size=1000     # Optional, default: 1000
)

# Convert friendly addresses back to raw format
raw_addresses = batch_convert_to_raw(
    friendly_addresses,
    chunk_size=1000     # Optional, default: 1000
)

Common Use Cases

  1. Processing block explorer data:
# Convert multiple raw addresses from block data
block_addresses = [tx['address'] for tx in block_transactions]
friendly_addresses = batch_convert_to_friendly(block_addresses)
  1. Converting user-input addresses:
# Convert user-friendly addresses to raw format for blockchain operations
user_addresses = ["EQBz8XrzcL2dH3VL6HqKLUbxeKpyqfwm-O2TBZdzE_XdKTXc"]
raw_addresses = batch_convert_to_raw(user_addresses)

Options

batch_convert_to_friendly

  • addresses: List of raw addresses to convert
  • bounceable: Whether to generate bounceable addresses (default: False)
  • test_only: Whether to generate testnet addresses (default: False)
  • url_safe: Whether to use URL-safe base64 encoding (default: True)
  • chunk_size: Size of chunks for parallel processing (default: 1000)

batch_convert_to_raw

  • addresses: List of friendly addresses to convert
  • chunk_size: Size of chunks for parallel processing (default: 1000)

Development

Requirements

  • Python 3.9+
  • Rust (latest stable)
  • maturin

Building from source

# Clone the repository
git clone https://github.com/your_username/ton_address_converter
cd ton_address_converter

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install development dependencies
pip install maturin pytest

# Build and install in development mode
maturin develop

# Run tests
pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for ton-address-converter 0.1.0

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

Source distribution (sdist)

Source distribution for ton-address-converter 0.1.0
File Size Uploaded
ton_address_converter-0.1.0.tar.gz 17.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ton-address-converter 0.1.0
File
ton_address_converter-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
ton_address_converter-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
ton_address_converter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
ton_address_converter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
ton_address_converter-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
ton_address_converter-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
ton_address_converter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
ton_address_converter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
ton_address_converter-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
ton_address_converter-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details
ton_address_converter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
ton_address_converter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
ton_address_converter-0.1.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
ton_address_converter-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.34+ x86-64 Details
ton_address_converter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
ton_address_converter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details

Total release size: 4.2 MB

Release files / ton_address_converter-0.1.0.tar.gz

Download URL ton_address_converter-0.1.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a4b63a1550cad1723ccfd303813d59cec08338e71fd8c848e499df8fca9f81fe
BLAKE2b-256 checksum
How to use checksums
66ed3fcc5712892ce44c643bd2265816ae374390541404c0853e9e679ede1f43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release files / ton_address_converter-0.1.0-cp312-cp312-win_amd64.whl

Download URL ton_address_converter-0.1.0-cp312-cp312-win_amd64.whl
Size 165.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
dfb47a749f485d4b23c9df0f1b5eb58a7637b19987dcc16fd6a4f5a38debba5a
BLAKE2b-256 checksum
How to use checksums
24d1a7ac39767e61c2a861cddd009273d9f1dcdb78425bb47bf26f1096f38dc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ton_address_converter-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL ton_address_converter-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Size 318.2 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
554c6e2c42b455407ae99ab42901a7237f9934dfac1fed04e0110f24a636f980
BLAKE2b-256 checksum
How to use checksums
c47e94878824e2003a130cbc5c833aaeef3989614baf1cecaa2f5cbd9a6938a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ton_address_converter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ton_address_converter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 284.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9bb3efffede8ecfce3a4f2e50a0db257645428c658324aa54aa9bda1437f12df
BLAKE2b-256 checksum
How to use checksums
9cd65632de3b544d130857dfe4320290d44ed0ec0b755cbe4534527b4a021b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ton_address_converter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL ton_address_converter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 276.9 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6e2ef9097480461cb111e18b3b707252c744bf95e2a6c616f99567efd3c5132a
BLAKE2b-256 checksum
How to use checksums
9d29a115997507e5b42a5b1845e9d708015a08a8c996da2f16ffcc0b3cc88d18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ton_address_converter-0.1.0-cp311-cp311-win_amd64.whl

Download URL ton_address_converter-0.1.0-cp311-cp311-win_amd64.whl
Size 165.7 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
27fe2883bdf1bcb9cf7c5b343ab096d1893aff003ad5676c80ef998d6ffd1120
BLAKE2b-256 checksum
How to use checksums
a0d29e731a8a57db508e528515e1596f8d5392b547f566f48e533e3ea2d547ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / ton_address_converter-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL ton_address_converter-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Size 318.2 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
79c2c91aa3d51cff238c6bce186baccad9f4dae0ee07bd434dd6d1a6a1241d2a
BLAKE2b-256 checksum
How to use checksums
b346695866c3705e8284f9ad2d67840c71dd5dc895a1db8b8bc36d55378174e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.11

Release files / ton_address_converter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ton_address_converter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 284.1 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fe68352fb1b07fb850fbc6f36a2bfc7553ee8ad88c49c2369ee21e3ba628246b
BLAKE2b-256 checksum
How to use checksums
fb76f28ac0203e29b5b41c1bd0a288c557d433c21dd95f82208f26eb047b9d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.11

Release files / ton_address_converter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL ton_address_converter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 276.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b1af55f8535fca6495a2d0b096ed2016552c454863e650aae7ac41217974e378
BLAKE2b-256 checksum
How to use checksums
0352c39950a8e619775b121dfc5db78b3d43d354e81e3204bd5c9c704bf0b130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / ton_address_converter-0.1.0-cp310-cp310-win_amd64.whl

Download URL ton_address_converter-0.1.0-cp310-cp310-win_amd64.whl
Size 165.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
79b6adbb7d6bfc7ab7b12fef5c0be787d291fdcb6804a063e887f2fbdb03360b
BLAKE2b-256 checksum
How to use checksums
28a8d42e5e1e596fa04a294797ac045d9321d6936774f6ece39ead54dc01ab04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / ton_address_converter-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL ton_address_converter-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Size 318.1 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
775e1efca27c91e8135ddfb60da02cc1bd64674c1e4d9b6bf59a28bdcd19a861
BLAKE2b-256 checksum
How to use checksums
aa955adf1439fda834e3d2e0cb6f120e70d6d815a03cf6fe0191041b2a3876d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Release files / ton_address_converter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ton_address_converter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 284.1 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
26486908e6a41e609eb9b679601fadd9870f0aec69c7355f2b4ac15d1133e73e
BLAKE2b-256 checksum
How to use checksums
c039d001af34d9b2054c5ace2e46f5b9a3489a61080d0e256d855e2664e98124
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Release files / ton_address_converter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL ton_address_converter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Size 276.9 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
faae275aa25d200429304bc7119010aaf359e62a04054fa7f3aa60bb751547f3
BLAKE2b-256 checksum
How to use checksums
b365535c9db4c02599087278aa498406e85c1df773ba3eca76dacf61f7918a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / ton_address_converter-0.1.0-cp39-cp39-win_amd64.whl

Download URL ton_address_converter-0.1.0-cp39-cp39-win_amd64.whl
Size 165.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e1e6084bb4d2f64117b9b75e5e74c8240f9d0881a9eff0275916657b01ae4a0b
BLAKE2b-256 checksum
How to use checksums
a0b317608ee81a8774d8a0913bdd132e1b538f6ff614813ec57d4b7ad68c73e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Release files / ton_address_converter-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl

Download URL ton_address_converter-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl
Size 318.0 kB
Tags CPython 3.9 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
6250a0cf6869a60b17c8dba693987c4a1bdd40d85c318427ed5f1f6d77522552
BLAKE2b-256 checksum
How to use checksums
d1180540411fe0b9e1010c7cc6ad03f07c22bb7d64edae0cbdf4ea85631d17af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release files / ton_address_converter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ton_address_converter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 284.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a2b6cd212664b75cd6dc2fd10cd6768c30896f3e35658e9a36d64359f0cf5898
BLAKE2b-256 checksum
How to use checksums
bf5fddd111c36596727ddd68e885486783794ce6e0c62b81faeaa2c42da531a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release files / ton_address_converter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL ton_address_converter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Size 276.8 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0d8ca65e19e83d4d162827f1573095f60107e0588aa08c325bd2bd758fce73f7
BLAKE2b-256 checksum
How to use checksums
08fe52aba52595939fd21c2df27c0238f0e3315a0e3e12fe6ff720bb3500739f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

17 release files

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