Skip to main content

Python bindings for tiny-bip39 RUST crate

Project description

py-bip39-bindings

Python bindings for the tiny-bip39 library: https://crates.io/crates/tiny-bip39

Reference to Reference to https://github.com/LocalCoinSwap/kusama-reference-implementation/tree/improve-trading-tests/bindings for the initial work

Documentation

https://docs.rs/py-bip39-bindings/

Installation

Install from PyPI

pip install py-bip39-bindings

Compile for local development

pip install -r requirements.txt
maturin develop

Build wheels

pip install -r requirements.txt

# Build local OS wheel
maturin build

# Build manylinux1 wheel
docker build . --tag polkasource/maturin
docker run --rm -i -v $(pwd):/io polkasource/maturin build

Examples

import binascii
from bip39 import bip39_to_mini_secret, bip39_generate, bip39_validate

mnemonic = bip39_generate(12)
bip39_validate(mnemonic)

seed_array = bip39_to_mini_secret(mnemonic, "")
seed_hex = binascii.hexlify(bytearray(seed_array)).decode("ascii")

Multi-language support

The following language codes are supported: 'en', 'zh-hans', 'zh-hant', 'fr', 'it', 'jap', 'ko', 'es'. Defaults to 'en'

mnemonic = bip39_generate(12, 'fr')
# 'moufle veinard tronc magasin merle amour toboggan admettre biotype décembre régalien billard'
bip39_validate(mnemonic, 'fr')

seed_array = bip39_to_mini_secret(mnemonic, "", 'fr')

mnemonic = bip39_generate(12, 'zh-hans')
# '观 敲 荣 硬 责 雪 专 宴 醇 飞 图 菌'

License

https://github.com/polkascan/py-bip39-bindings/blob/master/LICENSE

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

py_bip39_bindings-0.1.11.tar.gz (18.1 kB view hashes)

Uploaded Source

Built Distributions

py_bip39_bindings-0.1.11-cp312-none-win_amd64.whl (284.9 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

py_bip39_bindings-0.1.11-cp312-none-win32.whl (296.4 kB view hashes)

Uploaded CPython 3.12 Windows x86

py_bip39_bindings-0.1.11-cp312-cp312-musllinux_1_1_x86_64.whl (481.1 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp312-cp312-musllinux_1_1_aarch64.whl (483.9 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

py_bip39_bindings-0.1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (451.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.12+ i686

py_bip39_bindings-0.1.11-cp312-cp312-macosx_10_12_x86_64.whl (406.2 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

py_bip39_bindings-0.1.11-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (798.2 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp311-none-win_amd64.whl (283.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

py_bip39_bindings-0.1.11-cp311-none-win32.whl (296.8 kB view hashes)

Uploaded CPython 3.11 Windows x86

py_bip39_bindings-0.1.11-cp311-cp311-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp311-cp311-manylinux_2_28_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARMv7l

py_bip39_bindings-0.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

py_bip39_bindings-0.1.11-cp311-cp311-macosx_11_0_arm64.whl (414.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (792.4 kB view hashes)

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

py_bip39_bindings-0.1.11-cp311-cp311-macosx_10_7_x86_64.whl (399.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

py_bip39_bindings-0.1.11-cp310-none-win_amd64.whl (283.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

py_bip39_bindings-0.1.11-cp310-none-win32.whl (296.8 kB view hashes)

Uploaded CPython 3.10 Windows x86

py_bip39_bindings-0.1.11-cp310-cp310-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp310-cp310-manylinux_2_28_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARMv7l

py_bip39_bindings-0.1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

py_bip39_bindings-0.1.11-cp310-cp310-macosx_11_0_arm64.whl (414.0 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (792.4 kB view hashes)

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

py_bip39_bindings-0.1.11-cp310-cp310-macosx_10_7_x86_64.whl (399.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

py_bip39_bindings-0.1.11-cp39-none-win_amd64.whl (283.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

py_bip39_bindings-0.1.11-cp39-none-win32.whl (296.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

py_bip39_bindings-0.1.11-cp39-cp39-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp39-cp39-manylinux_2_28_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARMv7l

py_bip39_bindings-0.1.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

py_bip39_bindings-0.1.11-cp39-cp39-macosx_11_0_arm64.whl (414.0 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (792.4 kB view hashes)

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

py_bip39_bindings-0.1.11-cp39-cp39-macosx_10_7_x86_64.whl (399.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

py_bip39_bindings-0.1.11-cp38-none-win_amd64.whl (283.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

py_bip39_bindings-0.1.11-cp38-none-win32.whl (296.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

py_bip39_bindings-0.1.11-cp38-cp38-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp38-cp38-manylinux_2_28_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARMv7l

py_bip39_bindings-0.1.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

py_bip39_bindings-0.1.11-cp38-cp38-macosx_11_0_arm64.whl (414.0 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (792.4 kB view hashes)

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

py_bip39_bindings-0.1.11-cp38-cp38-macosx_10_7_x86_64.whl (399.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

py_bip39_bindings-0.1.11-cp37-none-win_amd64.whl (283.5 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

py_bip39_bindings-0.1.11-cp37-none-win32.whl (296.7 kB view hashes)

Uploaded CPython 3.7 Windows x86

py_bip39_bindings-0.1.11-cp37-cp37m-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

py_bip39_bindings-0.1.11-cp37-cp37m-manylinux_2_28_armv7l.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.28+ ARMv7l

py_bip39_bindings-0.1.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

py_bip39_bindings-0.1.11-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

py_bip39_bindings-0.1.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ i686

py_bip39_bindings-0.1.11-cp37-cp37m-macosx_11_0_arm64.whl (414.0 kB view hashes)

Uploaded CPython 3.7m macOS 11.0+ ARM64

py_bip39_bindings-0.1.11-cp37-cp37m-macosx_10_7_x86_64.whl (399.4 kB view hashes)

Uploaded CPython 3.7m 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