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
Metadata
Release files for python-coinage 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-coinage-1.0.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_coinage-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.1 kB
Release files / python-coinage-1.0.0.tar.gz
| Download URL | python-coinage-1.0.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a2a0796d11ba45e10413010930ae9560817c790839eb16c30fea25628e350b0
|
|
BLAKE2b-256 checksum How to use checksums |
8371b17f42650caee7f36bc737a967aa95c939b315bfd54c4a8656c79f63c0f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / python_coinage-1.0.0-py3-none-any.whl
| Download URL | python_coinage-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74432c7f4a92516d357977e99861f9749a3472c4722efad4b1188461470edeb1
|
|
BLAKE2b-256 checksum How to use checksums |
eca641a8491770bb10341ce17238933bb3b000c0cd6f8399052711bb51c872ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|