Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oskyk/cashaddress
Python tool for convert bitcoin cash legacy addresses
https://github.com/oskyk/cashaddress
address bech32 bitcoin-cash bitcoincash cashaddr convert legacy validate
Last synced: 9 days ago
JSON representation
Python tool for convert bitcoin cash legacy addresses
- Host: GitHub
- URL: https://github.com/oskyk/cashaddress
- Owner: oskyk
- License: mit
- Created: 2018-01-10T08:14:40.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T05:40:08.000Z (11 months ago)
- Last Synced: 2025-01-16T07:11:03.520Z (17 days ago)
- Topics: address, bech32, bitcoin-cash, bitcoincash, cashaddr, convert, legacy, validate
- Language: Python
- Size: 38.1 KB
- Stars: 46
- Watchers: 7
- Forks: 36
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/oskyk/cashaddress.svg?branch=master)](https://travis-ci.org/oskyk/cashaddress)
[![Coverage Status](https://coveralls.io/repos/github/oskyk/cashaddress/badge.svg)](https://coveralls.io/github/oskyk/cashaddress)# cashaddress
`cashaddress` is python library which is able to convert legacy BCH address to new format.# Installation
To install this library and its dependencies use:pip install cashaddress
# Usage examples
The first thing you need to do is import the library via:```python
from cashaddress import convert
```
## Converting address
**It does not matter if you use legacy or new address as input.**Then you can convert your address via:
```python
address = convert.to_cash_address('155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4')
```or
```python
address = convert.to_legacy_address('bitcoincash:qqkv9wr69ry2p9l53lxp635va4h86wv435995w8p2h')
```
## Validating address
You can also validate address via:```python
convert.is_valid('155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4')
```or
```python
convert.is_valid('bitcoincash:qqkv9wr69ry2p9l53lxp635va4h86wv435995w8p2h')
```# Development
1. Clone the repository
2. Create virtualenv
4. Do your thing
5. Run testspytest