mnemonic


Namemnemonic JSON
Version 0.21 PyPI version JSON
download
home_page
SummaryImplementation of Bitcoin BIP-0039
upload_time2024-01-05 10:46:14
maintainer
docs_urlNone
authorTrezor
requires_python>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            python-mnemonic
===============

.. image:: https://badge.fury.io/py/mnemonic.svg
    :target: https://badge.fury.io/py/mnemonic

Reference implementation of BIP-0039: Mnemonic code for generating
deterministic keys

Abstract
--------

This BIP describes the implementation of a mnemonic code or mnemonic sentence --
a group of easy to remember words -- for the generation of deterministic wallets.

It consists of two parts: generating the mnenomic, and converting it into a
binary seed. This seed can be later used to generate deterministic wallets using
BIP-0032 or similar methods.

BIP Paper
---------

See https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
for full specification

Installation
------------

To install this library and its dependencies use:

 ``pip install mnemonic``

Usage examples
--------------

Import library into python project via:

.. code-block:: python

   from mnemonic import Mnemonic

Initialize class instance, picking from available dictionaries:

- english
- chinese_simplified
- chinese_traditional
- french
- italian
- japanese
- korean
- spanish
- turkish
- czech
- portuguese

.. code-block:: python

   mnemo = Mnemonic(language)
   mnemo = Mnemonic("english")

Generate word list given the strength (128 - 256):

.. code-block:: python

   words = mnemo.generate(strength=256)

Given the word list and custom passphrase (empty in example), generate seed:

.. code-block:: python

   seed = mnemo.to_seed(words, passphrase="")

Given the word list, calculate original entropy:

.. code-block:: python

   entropy = mnemo.to_entropy(words)

Changelog
=========

.. default-role:: code

All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog`_, and this project adheres to
`Semantic Versioning`_.

`0.21`_ - 2024-01-05
--------------------

.. _0.21: https://github.com/trezor/python-mnemonic/compare/v0.20...v0.21

Added
~~~~~

- Czech and Portuguese wordlists
- Option to provide custom list of words instead of loading from built-in file

Changed
~~~~~~~

- Use `secrets` module for randomness
- Use English as a default language if none is provided
- Language detection is unambiguous even if some words are ambiguous
- Build system switched to Poetry

Removed
~~~~~~~

- Support for Python below 3.8 was dropped


`0.20`_ - 2021-07-27
---------------------

.. _0.20: https://github.com/trezor/python-mnemonic/compare/v0.19...v0.20

Added
~~~~~

- Type annotations
- Support for testnet private keys

Changed
~~~~~~~

- Project directory structure was cleaned up
- Language on the `Mnemonic` object is remembered instead of repeatedly detecting

Removed
~~~~~~~

- Support for Python 2.7 and 3.4 was dropped



0.19 - 2019-10-01
------------------

Added
~~~~~

- Start of changelog


.. _Keep a Changelog: https://keepachangelog.com/en/1.0.0/
.. _Semantic Versioning: https://semver.org/spec/v2.0.0.html

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mnemonic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1",
    "maintainer_email": "",
    "keywords": "",
    "author": "Trezor",
    "author_email": "info@trezor.io",
    "download_url": "https://files.pythonhosted.org/packages/ff/77/e6232ed59fbd7b90208bb8d4f89ed5aabcf30a524bc2fb8f0dafbe8e7df9/mnemonic-0.21.tar.gz",
    "platform": null,
    "description": "python-mnemonic\n===============\n\n.. image:: https://badge.fury.io/py/mnemonic.svg\n    :target: https://badge.fury.io/py/mnemonic\n\nReference implementation of BIP-0039: Mnemonic code for generating\ndeterministic keys\n\nAbstract\n--------\n\nThis BIP describes the implementation of a mnemonic code or mnemonic sentence --\na group of easy to remember words -- for the generation of deterministic wallets.\n\nIt consists of two parts: generating the mnenomic, and converting it into a\nbinary seed. This seed can be later used to generate deterministic wallets using\nBIP-0032 or similar methods.\n\nBIP Paper\n---------\n\nSee https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\nfor full specification\n\nInstallation\n------------\n\nTo install this library and its dependencies use:\n\n ``pip install mnemonic``\n\nUsage examples\n--------------\n\nImport library into python project via:\n\n.. code-block:: python\n\n   from mnemonic import Mnemonic\n\nInitialize class instance, picking from available dictionaries:\n\n- english\n- chinese_simplified\n- chinese_traditional\n- french\n- italian\n- japanese\n- korean\n- spanish\n- turkish\n- czech\n- portuguese\n\n.. code-block:: python\n\n   mnemo = Mnemonic(language)\n   mnemo = Mnemonic(\"english\")\n\nGenerate word list given the strength (128 - 256):\n\n.. code-block:: python\n\n   words = mnemo.generate(strength=256)\n\nGiven the word list and custom passphrase (empty in example), generate seed:\n\n.. code-block:: python\n\n   seed = mnemo.to_seed(words, passphrase=\"\")\n\nGiven the word list, calculate original entropy:\n\n.. code-block:: python\n\n   entropy = mnemo.to_entropy(words)\n\nChangelog\n=========\n\n.. default-role:: code\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on `Keep a Changelog`_, and this project adheres to\n`Semantic Versioning`_.\n\n`0.21`_ - 2024-01-05\n--------------------\n\n.. _0.21: https://github.com/trezor/python-mnemonic/compare/v0.20...v0.21\n\nAdded\n~~~~~\n\n- Czech and Portuguese wordlists\n- Option to provide custom list of words instead of loading from built-in file\n\nChanged\n~~~~~~~\n\n- Use `secrets` module for randomness\n- Use English as a default language if none is provided\n- Language detection is unambiguous even if some words are ambiguous\n- Build system switched to Poetry\n\nRemoved\n~~~~~~~\n\n- Support for Python below 3.8 was dropped\n\n\n`0.20`_ - 2021-07-27\n---------------------\n\n.. _0.20: https://github.com/trezor/python-mnemonic/compare/v0.19...v0.20\n\nAdded\n~~~~~\n\n- Type annotations\n- Support for testnet private keys\n\nChanged\n~~~~~~~\n\n- Project directory structure was cleaned up\n- Language on the `Mnemonic` object is remembered instead of repeatedly detecting\n\nRemoved\n~~~~~~~\n\n- Support for Python 2.7 and 3.4 was dropped\n\n\n\n0.19 - 2019-10-01\n------------------\n\nAdded\n~~~~~\n\n- Start of changelog\n\n\n.. _Keep a Changelog: https://keepachangelog.com/en/1.0.0/\n.. _Semantic Versioning: https://semver.org/spec/v2.0.0.html\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Implementation of Bitcoin BIP-0039",
    "version": "0.21",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57485abb16ce7f9d97b728e6b97c704ceaa614362e0847651f379ed0511942a0",
                "md5": "8dda7d2c2ec230fe4c1117e9b68489c8",
                "sha256": "72dc9de16ec5ef47287237b9b6943da11647a03fe7cf1f139fc3d7c4a7439288"
            },
            "downloads": -1,
            "filename": "mnemonic-0.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8dda7d2c2ec230fe4c1117e9b68489c8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1",
            "size": 92701,
            "upload_time": "2024-01-05T10:46:12",
            "upload_time_iso_8601": "2024-01-05T10:46:12.703703Z",
            "url": "https://files.pythonhosted.org/packages/57/48/5abb16ce7f9d97b728e6b97c704ceaa614362e0847651f379ed0511942a0/mnemonic-0.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff77e6232ed59fbd7b90208bb8d4f89ed5aabcf30a524bc2fb8f0dafbe8e7df9",
                "md5": "21de7ae71ecf0a8b7a764bbb9a6268ca",
                "sha256": "1fe496356820984f45559b1540c80ff10de448368929b9c60a2b55744cc88acf"
            },
            "downloads": -1,
            "filename": "mnemonic-0.21.tar.gz",
            "has_sig": false,
            "md5_digest": "21de7ae71ecf0a8b7a764bbb9a6268ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1",
            "size": 152462,
            "upload_time": "2024-01-05T10:46:14",
            "upload_time_iso_8601": "2024-01-05T10:46:14.895370Z",
            "url": "https://files.pythonhosted.org/packages/ff/77/e6232ed59fbd7b90208bb8d4f89ed5aabcf30a524bc2fb8f0dafbe8e7df9/mnemonic-0.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-05 10:46:14",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mnemonic"
}
        
Elapsed time: 0.77423s