# CoinAddrValidator
[![Github Repo](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/nobitex/coinaddrvalidator) [![Pypi Version](https://img.shields.io/pypi/v/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi License](https://img.shields.io/pypi/l/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi Wheel](https://img.shields.io/pypi/wheel/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi Versions](https://img.shields.io/pypi/pyversions/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator)
## Maintainer
Mohammad Aghamir - *Maintainer of this repository* - [coinaddrvalidator](https://github.com/nobitex/coinaddrvalidator)
## Fork Maintainer
Devmons s.r.o. - *Maintainer of this fork* - [coinaddrng](https://github.com/crypkit/coinaddrng)
See also the list of [contributors](https://github.com/crypkit/coinaddrng/contributors) who participated in this project.
## Original Maintainer
Joe Black | <me@joeblack.nyc> | [github](https://github.com/joeblackwaslike)
## Introduction
A cryptocurrency address inspection/validation library for python.
### Supported currencies
* binancecoin
* bitcoin
* bitcoin-sv
* bitcoin-cash
* boscoin
* cardano
* cosmos
* dashcoin
* decred
* dogecoin
* eos
* ethereum
* ethereum-classic
* ether-zero
* groestlcoin
* horizen
* kusama
* litecoin
* neocoin
* ontology
* polkadot
* ravencoin
* ripple
* stellar
* tezos
* tronix
* vechain
* zcash
## Installation
```shell
pip3 install coinaddrvalidator
```
## Usage
```python
>>> import coinaddrvalidator
>>> coinaddrvalidator.validate('btc', b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT')
ValidationResult(name='bitcoin', ticker='btc', address=b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT', valid=True, network='main', is_extended=False, address_type='address')
```
ValidationResult returns coin name and ticker, address, if the address is valid or not. In case network prefix bytes are defined for the checked currency, then the network
is returned, too. If the coin supports that and the address is an extended key, it returns if it is valid or not. For some coins the address type can be guessed based on its
format, which is returned as address_type. If there's none, 'address' is being returned as a default.
### Extending
#### Currencies
To add a new currency, simply instantiate a new `coinaddr.currency.Currency` class. It will be automatically registered.
```python
from coinaddrvalidator import Currency
Currency('decred', ticker='dcr', validator='DecredCheck',
networks=dict(
main=(0x073f,0x071a,0x02fda926), test=(0x0f21,0x0efc,0x043587d1)),
address_types=dict(
address=(0x073f,0x0f21), ticket=(0x071a,0x0efc),
xpubkey=(0x02fda926,0x043587d1)))
```
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)
Raw data
{
"_id": null,
"home_page": "https://github.com/nobitex/coinaddrvalid",
"name": "coinaddrvalidator",
"maintainer": "Mohammad Aghamir",
"docs_url": null,
"requires_python": null,
"maintainer_email": "maghamir@nobitex.net",
"keywords": "bitcoin, litecoin, altcoin, ethereum, address, validation, inspection",
"author": "Mohammad Aghamir",
"author_email": "maghamir@nobitex.net",
"download_url": "https://files.pythonhosted.org/packages/71/aa/0c0c0dad1ee47cbc63bbb772abd9e86faf5d4a18e9a8654fb89b46f31474/coinaddrvalidator-1.2.2.tar.gz",
"platform": null,
"description": "# CoinAddrValidator\n[![Github Repo](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/nobitex/coinaddrvalidator) [![Pypi Version](https://img.shields.io/pypi/v/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi License](https://img.shields.io/pypi/l/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi Wheel](https://img.shields.io/pypi/wheel/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator) [![Pypi Versions](https://img.shields.io/pypi/pyversions/coinaddrvalidator.svg)](https://pypi.python.org/pypi/coinaddrvalidator)\n\n## Maintainer\nMohammad Aghamir - *Maintainer of this repository* - [coinaddrvalidator](https://github.com/nobitex/coinaddrvalidator)\n\n## Fork Maintainer\nDevmons s.r.o. - *Maintainer of this fork* - [coinaddrng](https://github.com/crypkit/coinaddrng)\n\nSee also the list of [contributors](https://github.com/crypkit/coinaddrng/contributors) who participated in this project.\n\n## Original Maintainer\nJoe Black | <me@joeblack.nyc> | [github](https://github.com/joeblackwaslike)\n\n\n## Introduction\nA cryptocurrency address inspection/validation library for python.\n\n### Supported currencies\n* binancecoin\n* bitcoin\n* bitcoin-sv\n* bitcoin-cash\n* boscoin\n* cardano\n* cosmos\n* dashcoin\n* decred\n* dogecoin\n* eos\n* ethereum\n* ethereum-classic\n* ether-zero\n* groestlcoin\n* horizen\n* kusama\n* litecoin\n* neocoin\n* ontology\n* polkadot\n* ravencoin\n* ripple\n* stellar\n* tezos\n* tronix\n* vechain\n* zcash\n\n## Installation\n```shell\npip3 install coinaddrvalidator\n```\n\n## Usage\n```python\n>>> import coinaddrvalidator\n>>> coinaddrvalidator.validate('btc', b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT')\nValidationResult(name='bitcoin', ticker='btc', address=b'1BoatSLRHtKNngkdXEeobR76b53LETtpyT', valid=True, network='main', is_extended=False, address_type='address')\n```\n\nValidationResult returns coin name and ticker, address, if the address is valid or not. In case network prefix bytes are defined for the checked currency, then the network\nis returned, too. If the coin supports that and the address is an extended key, it returns if it is valid or not. For some coins the address type can be guessed based on its\nformat, which is returned as address_type. If there's none, 'address' is being returned as a default.\n\n### Extending\n#### Currencies\nTo add a new currency, simply instantiate a new `coinaddr.currency.Currency` class. It will be automatically registered.\n```python\nfrom coinaddrvalidator import Currency\nCurrency('decred', ticker='dcr', validator='DecredCheck',\n networks=dict(\n main=(0x073f,0x071a,0x02fda926), test=(0x0f21,0x0efc,0x043587d1)),\n address_types=dict(\n address=(0x073f,0x0f21), ticket=(0x071a,0x0efc),\n xpubkey=(0x02fda926,0x043587d1)))\n```\n\nTo override a default currency, simply instantiate a new currency with that name.\n\n\n#### Validators\nTo 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.\n```python\nfrom zope.interface import implementer\nfrom coinaddr.interfaces import IValidator\nfrom coinaddr import ValidatorBase\n\n\n@implementer(IValidator)\nclass NewValidator(ValidatorBase):\n name = 'New'\n\n @property\n def networks(self):\n return 'testing'\n\n def validate(self):\n return True\n```\n\nTo override a default validator, simply create a new validator with that name.\n\n\n## Changes\n* [CHANGELOG](CHANGELOG.md)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A crypto-currency address inspection/validation library.",
"version": "1.2.2",
"project_urls": {
"Download": "https://github.com/nobitex/coinaddrvalid/tarball/v1.2.2",
"Homepage": "https://github.com/nobitex/coinaddrvalid"
},
"split_keywords": [
"bitcoin",
" litecoin",
" altcoin",
" ethereum",
" address",
" validation",
" inspection"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8045ff9dae640d9386bd91d1e146925797235a9a5d6b1596ebf7d9c8467eaa62",
"md5": "39bf63b814934e488e7dffa95b382218",
"sha256": "f132dead1e678285da1fff4b271c5dc241691cedbc88bef29159beae7a198a62"
},
"downloads": -1,
"filename": "coinaddrvalidator-1.2.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "39bf63b814934e488e7dffa95b382218",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 19412,
"upload_time": "2024-08-07T13:20:07",
"upload_time_iso_8601": "2024-08-07T13:20:07.536780Z",
"url": "https://files.pythonhosted.org/packages/80/45/ff9dae640d9386bd91d1e146925797235a9a5d6b1596ebf7d9c8467eaa62/coinaddrvalidator-1.2.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "71aa0c0c0dad1ee47cbc63bbb772abd9e86faf5d4a18e9a8654fb89b46f31474",
"md5": "a402ad70a464a09c9a48bfdf8bc02ba0",
"sha256": "63ec1451f1da79c22dbdf9e667aafb212a8a922b403cf873aab9b8117448b600"
},
"downloads": -1,
"filename": "coinaddrvalidator-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "a402ad70a464a09c9a48bfdf8bc02ba0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18367,
"upload_time": "2024-08-07T13:20:09",
"upload_time_iso_8601": "2024-08-07T13:20:09.576543Z",
"url": "https://files.pythonhosted.org/packages/71/aa/0c0c0dad1ee47cbc63bbb772abd9e86faf5d4a18e9a8654fb89b46f31474/coinaddrvalidator-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-07 13:20:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nobitex",
"github_project": "coinaddrvalid",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "coinaddrvalidator"
}