Skip to main content

Tools for converting python data types

Project description

convertertools

CI Status Documentation Status Test coverage percentage

Poetry Ruff pre-commit

PyPI Version Supported Python versions License


Documentation: https://convertertools.readthedocs.io

Source Code: https://github.com/bluetooth-devices/convertertools


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.

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):

Bluetooth Devices
Bluetooth Devices

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Copier and the browniebroke/pypackage-template project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

convertertools-0.5.0.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distributions

convertertools-0.5.0-cp312-cp312-win_amd64.whl (70.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

convertertools-0.5.0-cp312-cp312-win32.whl (67.5 kB view hashes)

Uploaded CPython 3.12 Windows x86

convertertools-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl (164.9 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

convertertools-0.5.0-cp312-cp312-musllinux_1_2_i686.whl (162.9 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

convertertools-0.5.0-cp312-cp312-manylinux_2_36_x86_64.whl (120.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.36+ x86-64

convertertools-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (168.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

convertertools-0.5.0-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (161.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

convertertools-0.5.0-cp312-cp312-macosx_14_0_arm64.whl (68.7 kB view hashes)

Uploaded CPython 3.12 macOS 14.0+ ARM64

convertertools-0.5.0-cp311-cp311-win_amd64.whl (69.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

convertertools-0.5.0-cp311-cp311-win32.whl (21.3 kB view hashes)

Uploaded CPython 3.11 Windows x86

convertertools-0.5.0-cp311-cp311-musllinux_1_2_x86_64.whl (115.4 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

convertertools-0.5.0-cp311-cp311-musllinux_1_2_i686.whl (112.2 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

convertertools-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (117.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

convertertools-0.5.0-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (111.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

convertertools-0.5.0-cp311-cp311-macosx_14_0_arm64.whl (22.7 kB view hashes)

Uploaded CPython 3.11 macOS 14.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page