Skip to main content

Python binding to tiny-bip39, the Rust case conversion library

Project description

pybip39

pybip39 is a fast Python library for BIP39 Bitcoin HD wallet mnemonic phrases. It supports multiple languages and allows for seed phrases of 12 to 24 words. pybip39 calls the Rust library tiny-bip39 under the hood, thus benefitting from Rust's speed and safety.

Online Docs.

Installation

pip install pybip39

Note: requires Python >= 3.7.

Usage:

from pybip39 import Mnemonic, Seed

mnemonic = Mnemonic()
# Get the phrase
phrase = mnemonic.phrase
print(f"phrase: {phrase}")
# Get the HD wallet seed
seed = Seed(mnemonic, "")
# get the HD wallet seed as raw bytes
seed_bytes = bytes(seed)
print(seed_bytes)

Documentation credit

Most of this documentation is copied from the tiny-bip39 docs.

Development

Setup

  1. Install poetry
  2. Install dev dependencies:
poetry install
  1. Activate the poetry shell:
poetry shell

Testing

  1. Run maturin develop to compile the Rust code.
  2. Run make fmt, make lint, and make test.

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

pybip39-0.1.0.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distributions

pybip39-0.1.0-cp37-abi3-win_amd64.whl (298.2 kB view hashes)

Uploaded CPython 3.7+ Windows x86-64

pybip39-0.1.0-cp37-abi3-win32.whl (288.9 kB view hashes)

Uploaded CPython 3.7+ Windows x86

pybip39-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.2+ x86-64

pybip39-0.1.0-cp37-abi3-musllinux_1_2_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pybip39-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl (1.6 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pybip39-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pybip39-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.5 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pybip39-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.4 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pybip39-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (1.4 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pybip39-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pybip39-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pybip39-0.1.0-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ x86-64

pybip39-0.1.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

pybip39-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (844.0 kB view hashes)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

pybip39-0.1.0-cp37-abi3-macosx_10_7_x86_64.whl (432.9 kB view hashes)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

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