Maintainer
Joe Black | me@joeblack.nyc | github
Introduction
A cryptocurrency address inspection/validation library for python.
Supported currencies
bitcoin
bitcoin-cash
litecoin
ethereum
ethereum-classic
ether-zero
dogecoin
dashcoin
neocoin
ripple
Installation
pip3 install coinaddr
Usage
>>> import coinaddr
>>> coinaddr.validate('btc', b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT')
ValidationResult(name='bitcoin', ticker='btc', address=b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT', valid=True, network='main')
Extending
Currencies
To add a new currency, simply instantiate a new coinaddr.currency.Currency class. It will be automatically registered.
from coinaddr import Currency
Currency('testcoin', ticker='ttc', validator='Base58Check',
networks=dict(
main=(0x00, 0x05), test=(0x6f, 0xc4)))
To override a default currency, simply instantiate a new currency with that name.
Validators
To add a new validator, simply create a subclass of coinaddr.validation.ValidatorBase with your own implementation that implements the coinaddr.interfaces.IValidator interface. It will be automatically registered.
from zope.interface import implementer
from coinaddr.interfaces import IValidator
from coinaddr import ValidatorBase
@implementer(IValidator)
class NewValidator(ValidatorBase):
name = 'New'
@property
def networks(self):
return 'testing'
def validate(self):
return True
To override a default validator, simply create a new validator with that name.
Changes
Release files for coinaddr 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coinaddr-1.0.1.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coinaddr-1.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / coinaddr-1.0.1.tar.gz
| Download URL | coinaddr-1.0.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2eddc4aac382536abf9612f7215c2cdc9be7673e6f8a4d46f676b62ae4e6838
|
|
BLAKE2b-256 checksum How to use checksums |
28c51644d80aa443d495b50d342e4b18cf45ff69fff3782f0792f736d02c4b93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / coinaddr-1.0.1-py2.py3-none-any.whl
| Download URL | coinaddr-1.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
55ff1961d5ea34dc8d3bacae676c1e0f8bdb5c23cac07b47bdfa6560f47390bc
|
|
BLAKE2b-256 checksum How to use checksums |
6160a20ee228229bd955db492a1fe8979123ff11c522790b5f3470f02cac5cef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |