multicollections.MultiDict stores multiple values for the same key while preserving insertion order. Its API follows multidict, but keys can be of arbitrary hashable types.
Installation
With pip:
pip install multicollections
or conda:
conda install -c conda-forge multicollections
Usage
from multicollections import MultiDict
d = MultiDict([("a", 1), ("b", 2), ("a", 3)])
d["a"]
# 1
d.getall("a")
# [1, 3]
list(d.items())
# [("a", 1), ("b", 2), ("a", 3)]
d.add("a", 4)
The multicollections.abc module provides abstract base classes for implementing other multi-value collections.
See the documentation for the full API.
Metadata
Release files for multicollections 1.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multicollections-1.1.7.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multicollections-1.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.9 kB
Release files / multicollections-1.1.7.tar.gz
| Download URL | multicollections-1.1.7.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4545a53d54703e80f1ee613f2015a6b365d4426d1cbf2491e09e7e7821d82043
|
|
BLAKE2b-256 checksum How to use checksums |
eb0c9c88577177a13407b31fa9ca98831782112530b48dab61e1e50d93883ab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / multicollections-1.1.7-py3-none-any.whl
| Download URL | multicollections-1.1.7-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
976f03e0696e854b31555b8d2017cdf7d01a5ba80b599250e70aea4fe979d653
|
|
BLAKE2b-256 checksum How to use checksums |
d3efc44c91a79bdd911460e852866d2ab46e56f666eb33a465294687be70b43e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|