| Name | altered-deckfmt JSON |
| Version |
0.1.1
JSON |
| download |
| home_page | None |
| Summary | A compact format to share decklists for Altered TCG |
| upload_time | 2024-08-31 18:17:59 |
| maintainer | Ajordat |
| docs_url | None |
| author | Ajordat, Taum |
| requires_python | >=3.12 |
| license | MIT License Copyright (c) 2024 Taum 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 |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# altered-deckfmt
> This repository is a Python library of the original specification defined in [Taum/altered-deckfmt](https://github.com/Taum/altered-deckfmt).
A Compact format to share decklists for Altered TCG.
This binary format can be encoded to Base64 to share decks in URL-safe codes. As an example, a reasonable decklist such as:
```
1 ALT_CORE_B_YZ_03_C
3 ALT_CORE_B_BR_16_R2
2 ALT_CORE_B_YZ_04_C
3 ALT_CORE_B_YZ_07_R1
1 ALT_CORE_B_BR_10_R2
1 ALT_CORE_B_MU_08_R2
3 ALT_CORE_B_YZ_06_C
2 ALT_CORE_B_YZ_11_C
1 ALT_CORE_B_YZ_12_C
3 ALT_CORE_B_YZ_14_C
3 ALT_CORE_B_BR_25_R2
3 ALT_CORE_B_YZ_19_C
1 ALT_CORE_B_BR_28_R2
3 ALT_CORE_B_MU_25_R2
3 ALT_CORE_B_YZ_21_C
3 ALT_CORE_B_YZ_22_C
2 ALT_CORE_B_YZ_24_C
1 ALT_CORE_B_YZ_26_C
1 ALT_CORE_B_YZ_25_C
```
Can be encoded into the string:
```
EBAk3DNQrEPHVKmIvGLLHMPONZvTFcuZvVPWLYHaHZA=
```
This project provides a Python package that can be imported into a project.
Demo page to encode/decode decklists: https://taum.github.io/altered-deckfmt/
Note that this is a Python implementation of [the original format specification](https://github.com/Taum/altered-deckfmt/blob/main/FORMAT_SPEC.md), which I will try to keep up to date.
## Installation
Install the [PyPI package](https://pypi.org/project/altered-deckfmt/) using `pip`.
```bash
pip install altered-deckfmt
```
## Usage
Encode a decklist:
```python
from altered_deckfmt import encode, EncodeException
decklist = """1 ALT_COREKS_B_AX_08_C
1 ALT_COREKS_B_AX_03_C
1 ALT_COREKS_B_AX_08_R1
"""
try:
encoded_decklist = encode(decklist)
print(encoded_decklist)
# EBAQ0oEjEoQ=
except EncodeException:
print("Failed to encode the decklist")
```
Decode a decklist:
```python
from altered_deckfmt import decode, DecodeException
encoded_decklist = "EBAQ0oEjEoQ="
try:
decklist = decode(encoded_decklist)
print(decklist)
# 1 ALT_COREKS_B_AX_08_C
# 1 ALT_COREKS_B_AX_03_C
# 1 ALT_COREKS_B_AX_08_R1
except DecodeException:
print("Failed to decode the decklist")
```
## Run Tests
```
python -m unittest discover tests
```
Raw data
{
"_id": null,
"home_page": null,
"name": "altered-deckfmt",
"maintainer": "Ajordat",
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Ajordat, Taum",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/fb/00/2d7fc374b6ae621354ac5089efd2a1fe1d53d6ec234ccd9faa9a656b6aa1/altered_deckfmt-0.1.1.tar.gz",
"platform": null,
"description": "# altered-deckfmt\r\n\r\n> This repository is a Python library of the original specification defined in [Taum/altered-deckfmt](https://github.com/Taum/altered-deckfmt).\r\n\r\nA Compact format to share decklists for Altered TCG.\r\n\r\nThis binary format can be encoded to Base64 to share decks in URL-safe codes. As an example, a reasonable decklist such as:\r\n\r\n```\r\n1 ALT_CORE_B_YZ_03_C\r\n3 ALT_CORE_B_BR_16_R2\r\n2 ALT_CORE_B_YZ_04_C\r\n3 ALT_CORE_B_YZ_07_R1\r\n1 ALT_CORE_B_BR_10_R2\r\n1 ALT_CORE_B_MU_08_R2\r\n3 ALT_CORE_B_YZ_06_C\r\n2 ALT_CORE_B_YZ_11_C\r\n1 ALT_CORE_B_YZ_12_C\r\n3 ALT_CORE_B_YZ_14_C\r\n3 ALT_CORE_B_BR_25_R2\r\n3 ALT_CORE_B_YZ_19_C\r\n1 ALT_CORE_B_BR_28_R2\r\n3 ALT_CORE_B_MU_25_R2\r\n3 ALT_CORE_B_YZ_21_C\r\n3 ALT_CORE_B_YZ_22_C\r\n2 ALT_CORE_B_YZ_24_C\r\n1 ALT_CORE_B_YZ_26_C\r\n1 ALT_CORE_B_YZ_25_C\r\n```\r\n\r\nCan be encoded into the string:\r\n```\r\nEBAk3DNQrEPHVKmIvGLLHMPONZvTFcuZvVPWLYHaHZA=\r\n```\r\n\r\nThis project provides a Python package that can be imported into a project.\r\n\r\nDemo page to encode/decode decklists: https://taum.github.io/altered-deckfmt/\r\n\r\nNote that this is a Python implementation of [the original format specification](https://github.com/Taum/altered-deckfmt/blob/main/FORMAT_SPEC.md), which I will try to keep up to date.\r\n\r\n## Installation\r\n\r\nInstall the [PyPI package](https://pypi.org/project/altered-deckfmt/) using `pip`.\r\n```bash\r\npip install altered-deckfmt\r\n```\r\n\r\n## Usage\r\n\r\nEncode a decklist:\r\n\r\n```python\r\nfrom altered_deckfmt import encode, EncodeException\r\n\r\n\r\ndecklist = \"\"\"1 ALT_COREKS_B_AX_08_C\r\n1 ALT_COREKS_B_AX_03_C\r\n1 ALT_COREKS_B_AX_08_R1\r\n\"\"\"\r\n\r\ntry:\r\n encoded_decklist = encode(decklist)\r\n print(encoded_decklist)\r\n # EBAQ0oEjEoQ=\r\nexcept EncodeException:\r\n print(\"Failed to encode the decklist\")\r\n```\r\n\r\nDecode a decklist:\r\n\r\n```python\r\nfrom altered_deckfmt import decode, DecodeException\r\n\r\n\r\nencoded_decklist = \"EBAQ0oEjEoQ=\"\r\n\r\ntry:\r\n decklist = decode(encoded_decklist)\r\n print(decklist)\r\n # 1 ALT_COREKS_B_AX_08_C\r\n # 1 ALT_COREKS_B_AX_03_C\r\n # 1 ALT_COREKS_B_AX_08_R1\r\nexcept DecodeException:\r\n print(\"Failed to decode the decklist\")\r\n```\r\n\r\n\r\n## Run Tests\r\n\r\n```\r\npython -m unittest discover tests\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Taum 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": "A compact format to share decklists for Altered TCG",
"version": "0.1.1",
"project_urls": {
"Issues": "https://github.com/Ajordat/altered_deckfmt/issues",
"Parent": "https://github.com/Taum/altered-deckfmt",
"Repository": "https://github.com/Ajordat/altered_deckfmt"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f356b01d57140bdb09e61e273007de286285e93ee2d16a27182ea01600e6d090",
"md5": "8c544e709a0a3e5cda389f1e41eae192",
"sha256": "71be634cf07c92d9bab5cebef0b65bc514271792dad8c8cbb17ee66dfec877ca"
},
"downloads": -1,
"filename": "altered_deckfmt-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c544e709a0a3e5cda389f1e41eae192",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 12471,
"upload_time": "2024-08-31T18:17:57",
"upload_time_iso_8601": "2024-08-31T18:17:57.974628Z",
"url": "https://files.pythonhosted.org/packages/f3/56/b01d57140bdb09e61e273007de286285e93ee2d16a27182ea01600e6d090/altered_deckfmt-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fb002d7fc374b6ae621354ac5089efd2a1fe1d53d6ec234ccd9faa9a656b6aa1",
"md5": "d5db50ae9f72222c20a9330e02b51119",
"sha256": "8635c895a162ee8b011f01e09a35f7553a1eee33a53805905edb9800f9c13568"
},
"downloads": -1,
"filename": "altered_deckfmt-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d5db50ae9f72222c20a9330e02b51119",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 11905,
"upload_time": "2024-08-31T18:17:59",
"upload_time_iso_8601": "2024-08-31T18:17:59.497150Z",
"url": "https://files.pythonhosted.org/packages/fb/00/2d7fc374b6ae621354ac5089efd2a1fe1d53d6ec234ccd9faa9a656b6aa1/altered_deckfmt-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-31 18:17:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ajordat",
"github_project": "altered_deckfmt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "altered-deckfmt"
}