# convertertools
<p align="center">
<a href="https://github.com/bluetooth-devices/convertertools/actions/workflows/ci.yml?query=branch%3Amain">
<img src="https://img.shields.io/github/actions/workflow/status/bluetooth-devices/convertertools/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
</a>
<a href="https://convertertools.readthedocs.io">
<img src="https://img.shields.io/readthedocs/convertertools.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
</a>
<a href="https://codecov.io/gh/bluetooth-devices/convertertools">
<img src="https://img.shields.io/codecov/c/github/bluetooth-devices/convertertools.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
</a>
</p>
<p align="center">
<a href="https://python-poetry.org/">
<img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
</a>
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
</a>
<a href="https://github.com/pre-commit/pre-commit">
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
</a>
</p>
<p align="center">
<a href="https://pypi.org/project/convertertools/">
<img src="https://img.shields.io/pypi/v/convertertools.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
</a>
<img src="https://img.shields.io/pypi/pyversions/convertertools.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
<img src="https://img.shields.io/pypi/l/convertertools.svg?style=flat-square" alt="License">
</p>
---
**Documentation**: <a href="https://convertertools.readthedocs.io" target="_blank">https://convertertools.readthedocs.io </a>
**Source Code**: <a href="https://github.com/bluetooth-devices/convertertools" target="_blank">https://github.com/bluetooth-devices/convertertools </a>
---
Tools for converting python data types
These are very simple tools for manipulating python data structures
to avoid writing out the same code many times in libraries.
## Installation
Install this via pip (or your favourite package manager):
`pip install convertertools`
## Usage
Note that specific types are required for maximum performance.
```python
from convertertools import del_dict_tuple, del_dict_set, pop_dict_tuple, pop_dict_set
# del_dict* raise KeyError on missing keys
del_dict_tuple(d, ("a", "b"))
del_dict_set(d, {"a", "b"})
# pop_dict* ignores missing keys
pop_dict_tuple(d, ("a", "b"))
pop_dict_set(d, {"a", "b"})
# pop_dict_set_if_none ignores missing keys and only
# removes them if their value is None
pop_dict_set_if_none(d, {"a", "b"})
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.openhomefoundation.org/"><img src="https://avatars.githubusercontent.com/u/109550163?v=4?s=80" width="80px;" alt="Bluetooth Devices"/><br /><sub><b>Bluetooth Devices</b></sub></a><br /><a href="https://github.com/bluetooth-devices/convertertools/commits?author=Bluetooth-Devices" title="Code">💻</a> <a href="#ideas-Bluetooth-Devices" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/bluetooth-devices/convertertools/commits?author=Bluetooth-Devices" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-end -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## Credits
This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.
Raw data
{
"_id": null,
"home_page": "https://github.com/bluetooth-devices/convertertools",
"name": "convertertools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "J. Nick Koston",
"author_email": "nick@koston.org",
"download_url": "https://files.pythonhosted.org/packages/2e/34/3f3fd57d0d3753fb2f69d09164e53a2766618fe3581525cdd23e3f6af1e3/convertertools-0.5.0.tar.gz",
"platform": null,
"description": "# convertertools\n\n<p align=\"center\">\n <a href=\"https://github.com/bluetooth-devices/convertertools/actions/workflows/ci.yml?query=branch%3Amain\">\n <img src=\"https://img.shields.io/github/actions/workflow/status/bluetooth-devices/convertertools/ci.yml?branch=main&label=CI&logo=github&style=flat-square\" alt=\"CI Status\" >\n </a>\n <a href=\"https://convertertools.readthedocs.io\">\n <img src=\"https://img.shields.io/readthedocs/convertertools.svg?logo=read-the-docs&logoColor=fff&style=flat-square\" alt=\"Documentation Status\">\n </a>\n <a href=\"https://codecov.io/gh/bluetooth-devices/convertertools\">\n <img src=\"https://img.shields.io/codecov/c/github/bluetooth-devices/convertertools.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://python-poetry.org/\">\n <img src=\"https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json\" alt=\"Poetry\">\n </a>\n <a href=\"https://github.com/astral-sh/ruff\">\n <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\">\n </a>\n <a href=\"https://github.com/pre-commit/pre-commit\">\n <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://pypi.org/project/convertertools/\">\n <img src=\"https://img.shields.io/pypi/v/convertertools.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n </a>\n <img src=\"https://img.shields.io/pypi/pyversions/convertertools.svg?style=flat-square&logo=python&logoColor=fff\" alt=\"Supported Python versions\">\n <img src=\"https://img.shields.io/pypi/l/convertertools.svg?style=flat-square\" alt=\"License\">\n</p>\n\n---\n\n**Documentation**: <a href=\"https://convertertools.readthedocs.io\" target=\"_blank\">https://convertertools.readthedocs.io </a>\n\n**Source Code**: <a href=\"https://github.com/bluetooth-devices/convertertools\" target=\"_blank\">https://github.com/bluetooth-devices/convertertools </a>\n\n---\n\nTools for converting python data types\n\nThese are very simple tools for manipulating python data structures\nto avoid writing out the same code many times in libraries.\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install convertertools`\n\n## Usage\n\nNote that specific types are required for maximum performance.\n\n```python\nfrom convertertools import del_dict_tuple, del_dict_set, pop_dict_tuple, pop_dict_set\n\n# del_dict* raise KeyError on missing keys\ndel_dict_tuple(d, (\"a\", \"b\"))\ndel_dict_set(d, {\"a\", \"b\"})\n\n# pop_dict* ignores missing keys\npop_dict_tuple(d, (\"a\", \"b\"))\npop_dict_set(d, {\"a\", \"b\"})\n\n# pop_dict_set_if_none ignores missing keys and only\n# removes them if their value is None\npop_dict_set_if_none(d, {\"a\", \"b\"})\n```\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://www.openhomefoundation.org/\"><img src=\"https://avatars.githubusercontent.com/u/109550163?v=4?s=80\" width=\"80px;\" alt=\"Bluetooth Devices\"/><br /><sub><b>Bluetooth Devices</b></sub></a><br /><a href=\"https://github.com/bluetooth-devices/convertertools/commits?author=Bluetooth-Devices\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#ideas-Bluetooth-Devices\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"https://github.com/bluetooth-devices/convertertools/commits?author=Bluetooth-Devices\" title=\"Documentation\">\ud83d\udcd6</a></td>\n </tr>\n </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Copier](https://copier.readthedocs.io/) and the\n[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)\nproject template.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tools for converting python data types",
"version": "0.5.0",
"project_urls": {
"Bug Tracker": "https://github.com/bluetooth-devices/convertertools/issues",
"Changelog": "https://github.com/bluetooth-devices/convertertools/blob/main/CHANGELOG.md",
"Documentation": "https://convertertools.readthedocs.io",
"Homepage": "https://github.com/bluetooth-devices/convertertools",
"Repository": "https://github.com/bluetooth-devices/convertertools"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "04da6e302adb7c00b39f5a334157411d543a269eefee0406df79c7e975b374d7",
"md5": "e4b6ccdd6695fb732dfe18fbadc83a26",
"sha256": "b723a3486f6250d5d738a31591776cbb20378177030a29f0e4fda56d7b99e795"
},
"downloads": -1,
"filename": "convertertools-0.5.0-cp311-cp311-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "e4b6ccdd6695fb732dfe18fbadc83a26",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 22748,
"upload_time": "2024-06-27T13:14:50",
"upload_time_iso_8601": "2024-06-27T13:14:50.029714Z",
"url": "https://files.pythonhosted.org/packages/04/da/6e302adb7c00b39f5a334157411d543a269eefee0406df79c7e975b374d7/convertertools-0.5.0-cp311-cp311-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d1157e029b8fa22febd76e84d0358b43c7d00407941ac024311b6b9cd122246b",
"md5": "d49f6568352a97b604f527534c1b8321",
"sha256": "fbf4a533608c525dfbbd9b931e290dd679a74a2d6630f0f2e04d1fa44b33f3b0"
},
"downloads": -1,
"filename": "convertertools-0.5.0-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "d49f6568352a97b604f527534c1b8321",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 111431,
"upload_time": "2024-06-27T13:14:51",
"upload_time_iso_8601": "2024-06-27T13:14:51.354219Z",
"url": "https://files.pythonhosted.org/packages/d1/15/7e029b8fa22febd76e84d0358b43c7d00407941ac024311b6b9cd122246b/convertertools-0.5.0-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc3adb9d9abc5aaa6931be4980c3408aa1a1d1bd1f78edddcb88a70682c86f46",
"md5": "abc9cf66d0373ebd972600f98987465f",
"sha256": "8069e4c6bc908b370bfdb9129af5011d40c0704bda265a8f56345001d0478e6b"
},
"downloads": -1,
"filename": "convertertools-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "abc9cf66d0373ebd972600f98987465f",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 117148,
"upload_time": "2024-06-27T13:14:53",
"upload_time_iso_8601": "2024-06-27T13:14:53.183384Z",
"url": "https://files.pythonhosted.org/packages/cc/3a/db9d9abc5aaa6931be4980c3408aa1a1d1bd1f78edddcb88a70682c86f46/convertertools-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "01b1cee68615a31e298d0a4f4535a37a34927af5b311398b17db9d637a3b1875",
"md5": "871151a2f19808e0632e3f16643f5058",
"sha256": "cfea4d24a8e988db79b2213124dafdd3d12dc3209c7d1d4d7205a21631bb8888"
},
"downloads": -1,
"filename": "convertertools-0.5.0-cp311-cp311-musllinux_1_2_i686.whl",
"has_sig": false,
"md5_digest": "871151a2f19808e0632e3f16643f5058",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 112227,
"upload_time": "2024-06-27T13:14:54",
"upload_time_iso_8601": "2024-06-27T13:14:54.405081Z",
"url": "https://files.pythonhosted.org/packages/01/b1/cee68615a31e298d0a4f4535a37a34927af5b311398b17db9d637a3b1875/convertertools-0.5.0-cp311-cp311-musllinux_1_2_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "94b488488966fe8217135232cd7a7d2ec6affd3519720a4dd22d78ff78da7b5e",
"md5": "7c977fa945f58d3f96e785e69f88b364",
"sha256": "021ff984d888b110040ea86a12ff8d02aa29a6f1b603bf88cd42b990f16e5f4e"
},
"downloads": -1,
"filename": "convertertools-0.5.0-cp312-cp312-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "7c977fa945f58d3f96e785e69f88b364",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 120562,
"upload_time": "2024-06-27T13:10:06",
"upload_time_iso_8601": "2024-06-27T13:10:06.035988Z",
"url": "https://files.pythonhosted.org/packages/94/b4/88488966fe8217135232cd7a7d2ec6affd3519720a4dd22d78ff78da7b5e/convertertools-0.5.0-cp312-cp312-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2e343f3fd57d0d3753fb2f69d09164e53a2766618fe3581525cdd23e3f6af1e3",
"md5": "c5520e90722d0e0febb817a1df7b086f",
"sha256": "477812a307adf368805da5ee2cbc2fe984ed305d76164fe3fbc2a9f9baf4c3f0"
},
"downloads": -1,
"filename": "convertertools-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "c5520e90722d0e0febb817a1df7b086f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5599,
"upload_time": "2024-06-27T13:10:07",
"upload_time_iso_8601": "2024-06-27T13:10:07.350898Z",
"url": "https://files.pythonhosted.org/packages/2e/34/3f3fd57d0d3753fb2f69d09164e53a2766618fe3581525cdd23e3f6af1e3/convertertools-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-27 13:10:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bluetooth-devices",
"github_project": "convertertools",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "convertertools"
}