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 hashes)
Built Distribution
Close
Hashes for python_coinage-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74432c7f4a92516d357977e99861f9749a3472c4722efad4b1188461470edeb1 |
|
MD5 | 121166aa7ffc5cff0638aca3a2847630 |
|
BLAKE2b-256 | eca641a8491770bb10341ce17238933bb3b000c0cd6f8399052711bb51c872ae |