dict_zip
zip and zip_longest for dict.
Installation
$ pip install dict-zip
Usage
dict_zip
dict_zip is zip for dict.
The result keeps the first dictionary's insertion order and skips keys
missing from any dictionary.
>>> from dict_zip import dict_zip
>>> dict_zip({'a': 1, 'b': 2}, {'a': 3, 'b': 4})
{'a': (1, 3), 'b': (2, 4)}
dict_zip_longest
dict_zip_longest is zip_longest for dict.
It fills with fillvalue (default: None) when argument dict doesn't have match key.
The result keeps keys in the order they are first seen while scanning the
input dictionaries from left to right.
>>> from dict_zip import dict_zip_longest
>>> dict_zip_longest({'a': 1, 'b': 2, 'c': 4}, {'a': 3, 'b': 4})
{'a': (1, 3), 'b': (2, 4), 'c': (4, None)}
map_keys, map_values, map_items
map_keys, map_values, and map_items are used to map keys, values, and items of dict.
>>> from dict_zip import map_keys
>>> map_keys({'a': 1, 'b': 2}, str.upper)
{'A': 1, 'B': 2}
>>> from dict_zip import map_values
>>> map_values({'a': 1, 'b': 2}, str)
{'a': '1', 'b': '2'}
>>> from dict_zip import map_items
>>> map_items({'a': 1, 'b': 2}, str.upper, str)
{'A': '1', 'B': '2'}
map_items accepts the key mapper as the second positional argument. The
keyword-only func= argument is kept as a backward-compatible alias for
key_func.
tuple_keys
tuple_keys is used to convert dict keys to tuple.
>>> from dict_zip import tuple_keys
>>> tuple_keys({'a': 1, 'b': 2})
{('a',): 1, ('b',): 2}
Type hints
dict_zip supports for type hints.
Development
This repository uses lefthook to run the same checks as CI locally, so problems surface before they reach CI.
# Install dependencies
uv sync
# Install the Git hooks (once; requires lefthook on your PATH)
lefthook install
Once installed, the hooks run automatically:
- pre-commit:
uv run poe check - pre-push:
uv run poe checkanduv run poe test
You can also run the checks manually:
uv run poe check
uv run poe test
CI still runs the full matrix (see .github/workflows/); the hooks only bring that
feedback earlier on your machine.
LICENSE
The 3-Clause BSD License. See also LICENSE file.
Metadata
Release files for dict-zip 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dict_zip-0.8.0.tar.gz | 55.5 kB | With provenance | Details for dict_zip-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dict_zip-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for dict_zip-0.8.0-py3-none-any.whl |
Total release size: 65.2 kB
Release files / dict_zip-0.8.0.tar.gz
| Download URL | dict_zip-0.8.0.tar.gz |
|---|---|
| Size | 55.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e939332df72fd4d8a4efff49cd11eadc9c743e215bd021f6975d38df975fb15
|
|
BLAKE2b-256 checksum How to use checksums |
99c624d13062fc5e4f9630844d652720cfbec4d43bcfa7bb9f9ffdc2c0f792fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / dict_zip-0.8.0-py3-none-any.whl
| Download URL | dict_zip-0.8.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cb50201961ff393676981b9b40ba58d8280d2b93fd907fe0701fcca85cb3094
|
|
BLAKE2b-256 checksum How to use checksums |
967ba707386762e38fa142a68e02d5b32c412b5325d638e802410c651b7d2973
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for dict-zip 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dict_zip-0.8.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.