Skip to content

Latest commit

 

History

366 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fully generic MultiDict implementation for Python


Documentation CI Codecov Ruff ty uv Publish PyPI PyPI - Python Version


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.

About

📚 A fully generic Python MultiDict implementation

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages