Skip to main content

Cryptocurrency address validation module

Project description

Coinage

Travis

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

Bitcoin wiki page about Bech32

BIP-0173

EIP-55

CashAddr Spec

Coinaddr Python Module

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

python-coinage-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

python_coinage-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

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

Hashes for python-coinage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5a2a0796d11ba45e10413010930ae9560817c790839eb16c30fea25628e350b0
MD5 2fb1e5331cc4034bf1b4ce968df75b9f
BLAKE2b-256 8371b17f42650caee7f36bc737a967aa95c939b315bfd54c4a8656c79f63c0f0

See more details on using hashes here.

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

Hashes for python_coinage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74432c7f4a92516d357977e99861f9749a3472c4722efad4b1188461470edeb1
MD5 121166aa7ffc5cff0638aca3a2847630
BLAKE2b-256 eca641a8491770bb10341ce17238933bb3b000c0cd6f8399052711bb51c872ae

See more details on using hashes here.

Supported by

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