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.5
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.5.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multicollections-1.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / multicollections-1.1.5.tar.gz
| Download URL | multicollections-1.1.5.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f1d4c17d24e14214cee3efb4b3f1b991c4c6651f1c5616adfce9c0428bbe15e
|
|
BLAKE2b-256 checksum How to use checksums |
03c8ffc3b1206341c4db43aae629e610db98a2a752573863c309e90b6108d424
|
| 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.5-py3-none-any.whl
| Download URL | multicollections-1.1.5-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e8803d1fe7c80370a7d3c1dc1abe1e7e5865e6dc985388d5ddcbbcb1f7f7f89
|
|
BLAKE2b-256 checksum How to use checksums |
02e4f3149e185000d30a2ffca73adf0df2b5bdb0a6655c3389b2613f5fc12c41
|
| 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}
|