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.6
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.6.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multicollections-1.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.9 kB
Release files / multicollections-1.1.6.tar.gz
| Download URL | multicollections-1.1.6.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bec01952d3b0372bffe62820adcb36b56964ad77ab149ff34bbd02198fd1917f
|
|
BLAKE2b-256 checksum How to use checksums |
4c669b52d552d8bcc84f024687a1bef102092333af817771b72675b6fb1039a0
|
| 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.6-py3-none-any.whl
| Download URL | multicollections-1.1.6-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a4fa1a2af7539b00413d0fc2504a63c3aad8bd039ce387727c9db474a8ba048
|
|
BLAKE2b-256 checksum How to use checksums |
c197180d87931d7c7b8dccf5741d8cb09af21df5ae28b0571f514822809331c4
|
| 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}
|