
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
attridict
Advanced tools
A dict implementation with support for easy and clean access of its values through attributes
A Python package implementing atrribute dictionary.
This provides an easier and cleaner way to access dict values using their keys as attributes. It is typically a dict child, maintaining all the dict functionalities, but including some extra features.
To install the package from PyPI, use:
pip install attridict
Creating an attridict object
>>> import attridict
>>> att = attridict()
>>> att
{}
>>> att.foo = "bar"
>>> att.foo
'bar'
>>> att
{'foo': 'bar'}
A dict can be converted into an attridict object by passing it as an argument
>>> import attridict
>>> data = {'red': 'hot', 'blue': 'cold'}
>>> colors = attridict(data)
>>> colors
{'red': 'hot', 'blue': 'cold'}
>>> colors.red
'hot'
Modifying attridict object
>>> import attridict
>>> data = {'red': 'hot', 'blue': 'cold'}
>>> colors = attridict(data)
>>> colors
{'red': 'hot', 'blue': 'cold'}
>>> colors.blue
'cold'
>>> colors.blue = "sky"
>>> colors.red = "rose"
>>> colors.blue
'sky'
>>> colors.red
'rose'
>>> colors
{'red': 'rose', 'blue': 'sky'}
>>> colors.green = "grass"
>>> colors
{'red': 'rose', 'blue': 'sky', 'green': 'grass'}
Typical dict operations work on attridict objects
>>> import attridict
>>> data = {'red': 'rose', 'blue': 'sky'}
>>> colors = attridict(data)
>>> colors
{'red': 'rose', 'blue': 'sky'}
>>> colors.red
'rose'
>>> colors["red"]
'rose'
>>> colors["red"] = "tomato"
>>> colors["red"]
'tomato'
>>> colors.red
'tomato'
Nested attribute access
>>> import attridict
>>> data = {'foo': {}}
>>> att = attridict(data)
>>> att
{'foo': {}}
>>> att.foo.bar = 'baz'
>>> att.foo.bar
'baz'
>>> att
{'foo': {'bar': 'baz'}}
YAML serializable
>>> import attridict
>>> import yaml
>>> data = {'foo': {'bar': 'baz'}}
>>> att = attridict(data)
>>> yaml.dump(att)
'!attridict\nfoo:\n bar: baz\n'
>>> yaml.safe_dump(att)
'foo:\n bar: baz\n'
The project is MIT licensed
FAQs
A dict implementation with support for easy and clean access of its values through attributes
We found that attridict demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.