..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University,
Galter Health Sciences Library & Learning Center.
base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
=================
base32-lib
=================
.. image:: https://img.shields.io/travis/inveniosoftware/base32-lib.svg
:target: https://travis-ci.org/inveniosoftware/base32-lib
.. image:: https://img.shields.io/coveralls/inveniosoftware/base32-lib.svg
:target: https://coveralls.io/r/inveniosoftware/base32-lib
.. image:: https://img.shields.io/github/tag/inveniosoftware/base32-lib.svg
:target: https://github.com/inveniosoftware/base32-lib/releases
.. image:: https://img.shields.io/pypi/dm/base32-lib.svg
:target: https://pypi.python.org/pypi/base32-lib
.. image:: https://img.shields.io/github/license/inveniosoftware/base32-lib.svg
:target: https://github.com/inveniosoftware/base32-lib/blob/master/LICENSE
Small library to generate, encode and decode random base32 strings with nice
properties.
Usage
=====
.. code-block:: python
import base32_lib as base32
# Generate
## Generate a random identifier
base32.generate()
# -> 'abcd1234'
# Generate a random identifier with bells and whistle
base32.generate(length=10, split_every=5, checksum=True)
# -> '3sbk2-5j060'
# Encode a pre-existing number
base32.encode(1234, split_every=3, checksum=True) == "16j-82"
# Decode an identifier
base32.decode("16j-82", checksum=True) == 1234
base32.decode("16i-82", checksum=True)
# raises ValueError
Features
========
- Generation, encoding and decoding of base32 strings
- Douglas Crockford base32 encoding
- URL-safe strings with no problematic special characters
- Decoding of any-case strings
- Configurable length strings
- Randomness through cryptographically secure random number generator
- Optional ISO-7064 checksum
- Optional hyphenation
Installation
============
The base32-lib package is on PyPI so all you need is:
.. code-block:: console
pip install base32-lib
Development
===========
.. code-block:: console
pipenv run pip install -e .[docs,tests]
Tests
-----
.. code-block:: console
pipenv run ./run-tests.sh
..
This file is part of base32-lib
Copyright (C) 2019 CERN.
Copyright (C) 2019 Northwestern University, Galter Health Sciences Library & Learning Center.
base32-lib is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
Changes
=======
Version 1.0.2 (2020-05-07)
- Deprecate Python versions lower than 3.6.0. Now supporting 3.6.0 and 3.7.0.
Version 1.0.1 (2019-11-15)
- Enforce appropriate length of the encoded base32 strings.
Version 1.0.0 (2019-11-06)
- First public release.
Raw data
{
"_id": null,
"home_page": "https://github.com/inveniosoftware/base32-lib",
"name": "base32-lib",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "base32 identifiers",
"author": "Invenio Software",
"author_email": "info@inveniosoftware.org",
"download_url": "https://files.pythonhosted.org/packages/04/ed/0752d75107d2ec3bb6a2f023f54fa81039f1062b913709b843205aee47ba/base32-lib-1.0.2.tar.gz",
"platform": "any",
"description": "..\n This file is part of base32-lib\n Copyright (C) 2019 CERN.\n Copyright (C) 2019 Northwestern University,\n Galter Health Sciences Library & Learning Center.\n\n base32-lib is free software; you can redistribute it and/or modify it\n under the terms of the MIT License; see LICENSE file for more details.\n\n\n=================\nbase32-lib\n=================\n\n.. image:: https://img.shields.io/travis/inveniosoftware/base32-lib.svg\n :target: https://travis-ci.org/inveniosoftware/base32-lib\n\n.. image:: https://img.shields.io/coveralls/inveniosoftware/base32-lib.svg\n :target: https://coveralls.io/r/inveniosoftware/base32-lib\n\n.. image:: https://img.shields.io/github/tag/inveniosoftware/base32-lib.svg\n :target: https://github.com/inveniosoftware/base32-lib/releases\n\n.. image:: https://img.shields.io/pypi/dm/base32-lib.svg\n :target: https://pypi.python.org/pypi/base32-lib\n\n.. image:: https://img.shields.io/github/license/inveniosoftware/base32-lib.svg\n :target: https://github.com/inveniosoftware/base32-lib/blob/master/LICENSE\n\n\nSmall library to generate, encode and decode random base32 strings with nice\nproperties.\n\nUsage\n=====\n\n.. code-block:: python\n\n import base32_lib as base32\n\n # Generate\n ## Generate a random identifier\n base32.generate()\n # -> 'abcd1234'\n\n # Generate a random identifier with bells and whistle\n base32.generate(length=10, split_every=5, checksum=True)\n # -> '3sbk2-5j060'\n\n # Encode a pre-existing number\n base32.encode(1234, split_every=3, checksum=True) == \"16j-82\"\n\n # Decode an identifier\n base32.decode(\"16j-82\", checksum=True) == 1234\n\n base32.decode(\"16i-82\", checksum=True)\n # raises ValueError\n\nFeatures\n========\n\n- Generation, encoding and decoding of base32 strings\n- Douglas Crockford base32 encoding\n- URL-safe strings with no problematic special characters\n- Decoding of any-case strings\n- Configurable length strings\n- Randomness through cryptographically secure random number generator\n- Optional ISO-7064 checksum\n- Optional hyphenation\n\n\nInstallation\n============\n\nThe base32-lib package is on PyPI so all you need is:\n\n.. code-block:: console\n\n pip install base32-lib\n\n\nDevelopment\n===========\n\n.. code-block:: console\n\n pipenv run pip install -e .[docs,tests]\n\nTests\n-----\n\n.. code-block:: console\n\n pipenv run ./run-tests.sh\n\n\n..\n This file is part of base32-lib\n Copyright (C) 2019 CERN.\n Copyright (C) 2019 Northwestern University, Galter Health Sciences Library & Learning Center.\n\n base32-lib is free software; you can redistribute it and/or modify it\n under the terms of the MIT License; see LICENSE file for more details.\n\nChanges\n=======\n\nVersion 1.0.2 (2020-05-07)\n\n- Deprecate Python versions lower than 3.6.0. Now supporting 3.6.0 and 3.7.0.\n\nVersion 1.0.1 (2019-11-15)\n\n- Enforce appropriate length of the encoded base32 strings.\n\nVersion 1.0.0 (2019-11-06)\n\n- First public release.\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Small library to generate, encode and decode random base32 strings.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/inveniosoftware/base32-lib"
},
"split_keywords": [
"base32",
"identifiers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c3c95a769cb6649f2fdf366e1c10db4cafd0e6c7f8b3575d6cb5917bb9298086",
"md5": "ed54c561860597f3b805e4ee8f548426",
"sha256": "f3cbc1c4b3df7af844c9b7ffc1638a688423db2b1e51082b2c014b3959b756ae"
},
"downloads": -1,
"filename": "base32_lib-1.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed54c561860597f3b805e4ee8f548426",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 6701,
"upload_time": "2020-05-07T14:46:11",
"upload_time_iso_8601": "2020-05-07T14:46:11.153995Z",
"url": "https://files.pythonhosted.org/packages/c3/c9/5a769cb6649f2fdf366e1c10db4cafd0e6c7f8b3575d6cb5917bb9298086/base32_lib-1.0.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "04ed0752d75107d2ec3bb6a2f023f54fa81039f1062b913709b843205aee47ba",
"md5": "19f035db8fcb57de7d0936bbd3817a55",
"sha256": "09663df621bbc454079a54c92fa25d3bc33ea4a191053a09dd1e05ea4c0fe47c"
},
"downloads": -1,
"filename": "base32-lib-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "19f035db8fcb57de7d0936bbd3817a55",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12969,
"upload_time": "2020-05-07T14:46:12",
"upload_time_iso_8601": "2020-05-07T14:46:12.518662Z",
"url": "https://files.pythonhosted.org/packages/04/ed/0752d75107d2ec3bb6a2f023f54fa81039f1062b913709b843205aee47ba/base32-lib-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-05-07 14:46:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "inveniosoftware",
"github_project": "base32-lib",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"lcname": "base32-lib"
}