Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeblackwaslike/coinaddr
Cryptocurrency address inspection/validation library for python
https://github.com/joeblackwaslike/coinaddr
Last synced: about 2 months ago
JSON representation
Cryptocurrency address inspection/validation library for python
- Host: GitHub
- URL: https://github.com/joeblackwaslike/coinaddr
- Owner: joeblackwaslike
- License: mit
- Created: 2018-04-07T15:11:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-10-17T15:25:43.000Z (about 2 years ago)
- Last Synced: 2024-11-08T22:53:31.935Z (2 months ago)
- Language: Python
- Size: 28.3 KB
- Stars: 18
- Watchers: 4
- Forks: 20
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CoinAddr
[![Build Status](https://travis-ci.org/joeblackwaslike/coinaddr.svg?branch=master)](https://travis-ci.org/joeblackwaslike/coinaddr) [![Github Repo](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/joeblackwaslike/coinaddr) [![Pypi Version](https://img.shields.io/pypi/v/coinaddr.svg)](https://pypi.python.org/pypi/coinaddr) [![Pypi License](https://img.shields.io/pypi/l/coinaddr.svg)](https://pypi.python.org/pypi/coinaddr) [![Pypi Wheel](https://img.shields.io/pypi/wheel/coinaddr.svg)](https://pypi.python.org/pypi/coinaddr) [![Pypi Versions](https://img.shields.io/pypi/pyversions/coinaddr.svg)](https://pypi.python.org/pypi/coinaddr)## Maintainer
Joe Black | | [github](https://github.com/joeblackwaslike)## 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
```shell
pip3 install coinaddr
```## Usage
```python
>>> 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.
```python
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.
```python
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
* [CHANGELOG](CHANGELOG.md)