class documentation
class Metadata(MutableSequence[
Constructor: Metadata(initial)
Mutable metadata collection with case-insensitive keys.
This container normalizes keys to lowercase and supports convenient indexing by integer, slice, or key string:
- metadata[i] returns the key/value tuple at index i.
- metadata[i:j] returns a list of key/value tuples.
- metadata["key"] returns a list of values for that key.
| Method | __delitem__ |
Delete metadata by numeric index, slice, or key. |
| Method | __getitem__ |
Return metadata entries by index, slice, or key. |
| Method | __has__ |
Return True if a key exists in the collection. |
| Method | __init__ |
Create a metadata collection. |
| Method | __len__ |
Return the number of stored entries. |
| Method | __repr__ |
Return a debug representation of the metadata. |
| Method | __setitem__ |
Set metadata by numeric index, slice, or key. |
| Method | add |
Append a key/value pair, lowercasing the key. |
| Method | get |
Return the first or last value for a key. |
| Method | insert |
Insert a key/value pair at the given index. |
| Instance Variable | _contents |
Undocumented |
def __setitem__(self, index:
int | slice | str, value: tuple[ str, str] | Iterable[ tuple[ str, str]] | Iterable[ str] | str):
(source)
¶
Set metadata by numeric index, slice, or key.