base62-py


Namebase62-py JSON
Version 1.3.13 PyPI version JSON
download
home_pageNone
SummaryCustom Base-62 Encoder in Python
upload_time2024-12-19 15:55:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10.2
licenseMIT License Copyright (c) 2024 Cyril Dever Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords base62 base-62 encoder decoder
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # base62-ts
_Custom Base-62 Encoder_

![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/base62)
![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/base62)
![GitHub issues](https://img.shields.io/github/issues/cyrildever/base62)
![npm](https://img.shields.io/npm/dw/base62-ts)
![NPM](https://img.shields.io/npm/l/base62-ts)

This repository contains the version of my encoder/decoder for Base-62 in three languages:
* [Golang](https://github.com/cyrildever/base62);
* Python;
* [TypeScript](https://github.com/cyrildever/base62/ts).


### Motivation

I needed an efficient way to apply a Base-62 encoding/decoding algorithm working the same way in TypeScript/Javascript, Golang and Python environments.


### Usage

Both versions use the same following dictionary:

| Value | Character | Value | Character | Value | Character | Value | Character | Value | Character |
|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|
|   0   |    `0`    |   13  |    `d`    |   26  |    `q`    |   39  |    `D`    |   52  |    `Q`    |
|   1   |    `1`    |   14  |    `e`    |   27  |    `r`    |   40  |    `E`    |   53  |    `R`    |
|   2   |    `2`    |   15  |    `f`    |   28  |    `s`    |   41  |    `F`    |   54  |    `S`    |
|   3   |    `3`    |   16  |    `g`    |   29  |    `t`    |   42  |    `G`    |   55  |    `T`    |
|   4   |    `4`    |   17  |    `h`    |   30  |    `u`    |   43  |    `H`    |   56  |    `U`    |
|   5   |    `5`    |   18  |    `i`    |   31  |    `v`    |   44  |    `I`    |   57  |    `V`    |
|   6   |    `6`    |   19  |    `j`    |   32  |    `w`    |   45  |    `J`    |   58  |    `W`    |
|   7   |    `7`    |   20  |    `k`    |   33  |    `x`    |   46  |    `K`    |   59  |    `X`    |
|   8   |    `8`    |   21  |    `l`    |   34  |    `y`    |   47  |    `L`    |   60  |    `Y`    |
|   9   |    `9`    |   22  |    `m`    |   35  |    `z`    |   48  |    `M`    |   61  |    `Z`    |
|   10  |    `a`    |   23  |    `n`    |   36  |    `A`    |   49  |    `N`    |       |           |
|   11  |    `b`    |   24  |    `o`    |   37  |    `B`    |   50  |    `O`    |       |           |
|   12  |    `c`    |   25  |    `p`    |   38  |    `C`    |   51  |    `P`    |       |           |

In other words, they use the following base: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.

```console
pip install base62-py
```

```python
from base62 import decode, encode

value = 18969

encoded = encode(value)

# 4VX
print(encoded)

decoded = decode(encoded)

assert value == decoded
```


### Tests

```console
$ pip install -e . && python3 -m unittest discover
```


### License

Both versions are available under a MIT license (see [LICENSE](LICENSE)).


<hr />
&copy; 2021-2024 Cyril Dever. All rights reserved.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "base62-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10.2",
    "maintainer_email": null,
    "keywords": "base62, base-62, encoder, decoder",
    "author": null,
    "author_email": "Cyril Dever <cdever@pep-s.com>",
    "download_url": "https://files.pythonhosted.org/packages/56/2e/1ea6e97e3d07022ec3e21bfc12de0af93a320c92b0ac01c4703a6d9b58e0/base62_py-1.3.13.tar.gz",
    "platform": null,
    "description": "# base62-ts\n_Custom Base-62 Encoder_\n\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/base62)\n![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/base62)\n![GitHub issues](https://img.shields.io/github/issues/cyrildever/base62)\n![npm](https://img.shields.io/npm/dw/base62-ts)\n![NPM](https://img.shields.io/npm/l/base62-ts)\n\nThis repository contains the version of my encoder/decoder for Base-62 in three languages:\n* [Golang](https://github.com/cyrildever/base62);\n* Python;\n* [TypeScript](https://github.com/cyrildever/base62/ts).\n\n\n### Motivation\n\nI needed an efficient way to apply a Base-62 encoding/decoding algorithm working the same way in TypeScript/Javascript, Golang and Python environments.\n\n\n### Usage\n\nBoth versions use the same following dictionary:\n\n| Value | Character | Value | Character | Value | Character | Value | Character | Value | Character |\n|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|\n|   0   |    `0`    |   13  |    `d`    |   26  |    `q`    |   39  |    `D`    |   52  |    `Q`    |\n|   1   |    `1`    |   14  |    `e`    |   27  |    `r`    |   40  |    `E`    |   53  |    `R`    |\n|   2   |    `2`    |   15  |    `f`    |   28  |    `s`    |   41  |    `F`    |   54  |    `S`    |\n|   3   |    `3`    |   16  |    `g`    |   29  |    `t`    |   42  |    `G`    |   55  |    `T`    |\n|   4   |    `4`    |   17  |    `h`    |   30  |    `u`    |   43  |    `H`    |   56  |    `U`    |\n|   5   |    `5`    |   18  |    `i`    |   31  |    `v`    |   44  |    `I`    |   57  |    `V`    |\n|   6   |    `6`    |   19  |    `j`    |   32  |    `w`    |   45  |    `J`    |   58  |    `W`    |\n|   7   |    `7`    |   20  |    `k`    |   33  |    `x`    |   46  |    `K`    |   59  |    `X`    |\n|   8   |    `8`    |   21  |    `l`    |   34  |    `y`    |   47  |    `L`    |   60  |    `Y`    |\n|   9   |    `9`    |   22  |    `m`    |   35  |    `z`    |   48  |    `M`    |   61  |    `Z`    |\n|   10  |    `a`    |   23  |    `n`    |   36  |    `A`    |   49  |    `N`    |       |           |\n|   11  |    `b`    |   24  |    `o`    |   37  |    `B`    |   50  |    `O`    |       |           |\n|   12  |    `c`    |   25  |    `p`    |   38  |    `C`    |   51  |    `P`    |       |           |\n\nIn other words, they use the following base: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.\n\n```console\npip install base62-py\n```\n\n```python\nfrom base62 import decode, encode\n\nvalue = 18969\n\nencoded = encode(value)\n\n# 4VX\nprint(encoded)\n\ndecoded = decode(encoded)\n\nassert value == decoded\n```\n\n\n### Tests\n\n```console\n$ pip install -e . && python3 -m unittest discover\n```\n\n\n### License\n\nBoth versions are available under a MIT license (see [LICENSE](LICENSE)).\n\n\n<hr />\n&copy; 2021-2024 Cyril Dever. All rights reserved.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Cyril Dever  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Custom Base-62 Encoder in Python",
    "version": "1.3.13",
    "project_urls": {
        "Homepage": "https://github.com/cyrildever/base62"
    },
    "split_keywords": [
        "base62",
        " base-62",
        " encoder",
        " decoder"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6b205cb10b41370dccc721e663130750780fc9303e539538f8e1a05db7a8e16",
                "md5": "1a9ee6ccfddfa4461e84ec674acee81c",
                "sha256": "94b91f4d289d412d1a193c91dce7af0723ec04e204310705dd4cbf2a809f0f0b"
            },
            "downloads": -1,
            "filename": "base62_py-1.3.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1a9ee6ccfddfa4461e84ec674acee81c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.2",
            "size": 5709,
            "upload_time": "2024-12-19T15:55:48",
            "upload_time_iso_8601": "2024-12-19T15:55:48.054930Z",
            "url": "https://files.pythonhosted.org/packages/f6/b2/05cb10b41370dccc721e663130750780fc9303e539538f8e1a05db7a8e16/base62_py-1.3.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "562e1ea6e97e3d07022ec3e21bfc12de0af93a320c92b0ac01c4703a6d9b58e0",
                "md5": "713222cc89c3bdfb1bd52c97510d3034",
                "sha256": "14f745783d1de8545aa165ac2e08da4fa7428d2a6f90df5fb9e532c3542b86bd"
            },
            "downloads": -1,
            "filename": "base62_py-1.3.13.tar.gz",
            "has_sig": false,
            "md5_digest": "713222cc89c3bdfb1bd52c97510d3034",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.2",
            "size": 4510,
            "upload_time": "2024-12-19T15:55:50",
            "upload_time_iso_8601": "2024-12-19T15:55:50.469245Z",
            "url": "https://files.pythonhosted.org/packages/56/2e/1ea6e97e3d07022ec3e21bfc12de0af93a320c92b0ac01c4703a6d9b58e0/base62_py-1.3.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-19 15:55:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cyrildever",
    "github_project": "base62",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "base62-py"
}
        
Elapsed time: 0.54358s