Cryptocurrency address validation module
Project description
Coinage
Coinage is a python module for validating cryptocurrency addresses with different formats among different blockchain networks.
Examples
from coinage import BitcoinBlockchain, FailedValidation, FailedChecksumValidation
btc = BitcoinBlockchain()
try:
valid = btc.validate('abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw')
if valid.is_from_main_net():
print('this address looks good')
else:
print('this isn\'t a mainnet address')
except FailedChecksumValidation:
print('you probably made a mistake when copying this address')
except FailedValidation:
print('this isnt a bitcoin address')
Or:
from coinage import BitcoinBlockchain, FailedValidation, FailedChecksumValidation
btc = BitcoinBlockchain()
result, details = btc.is_valid('abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw')
if result:
if details.is_from_main_net():
print('this address looks good')
else:
print('this isn\'t a mainnet address')
else:
print('this isnt a valid bitcoin address')
Sources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-coinage-1.0.0.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-coinage-1.0.0.tar.gz.
File metadata
- Download URL: python-coinage-1.0.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a2a0796d11ba45e10413010930ae9560817c790839eb16c30fea25628e350b0
|
|
| MD5 |
2fb1e5331cc4034bf1b4ce968df75b9f
|
|
| BLAKE2b-256 |
8371b17f42650caee7f36bc737a967aa95c939b315bfd54c4a8656c79f63c0f0
|
File details
Details for the file python_coinage-1.0.0-py3-none-any.whl.
File metadata
- Download URL: python_coinage-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74432c7f4a92516d357977e99861f9749a3472c4722efad4b1188461470edeb1
|
|
| MD5 |
121166aa7ffc5cff0638aca3a2847630
|
|
| BLAKE2b-256 |
eca641a8491770bb10341ce17238933bb3b000c0cd6f8399052711bb51c872ae
|