Skip to main content
Glama
bound_dictionary.py717 B
# Copyright (c) 2010-2024 openpyxl from collections import defaultdict class BoundDictionary(defaultdict): """ A default dictionary where elements are tightly coupled. The factory method is responsible for binding the parent object to the child. If a reference attribute is assigned then child objects will have the key assigned to this. Otherwise it's just a defaultdict. """ def __init__(self, reference=None, *args, **kw): self.reference = reference super().__init__(*args, **kw) def __getitem__(self, key): value = super().__getitem__(key) if self.reference is not None: setattr(value, self.reference, key) return value

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lillard01/chatExcel-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server