magicattr
A getattr and setattr that works on nested objects, lists, dicts, and any combination thereof without resorting to eval
Decision gist · record as of 2026-08-14
Yes, if you need safe nested attribute access and can accept an abandoned package. The code is simple and has no dependencies, so the risk of breakage is low for stable use cases. However, do not rely on it for new projects requiring active maintenance or support for future Python versions—consider it a utility for existing codebases where the feature set is complete and stable.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- However, the package is abandoned—last commit was 2022-02-18 and no releases since 2022-01-25, so it will not receive bug fixes or maintenance.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
last release 2022-01-25 (1662 days) · last repo commit 2022-02-18 · 18 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,930,589 downloads/mo, #2,008 on PyPI
Alternatives
Verify before relying
pip install magicattr
import magicattr
class Person:
settings = {'style': {'width': 200}}
def __init__(self, name):
self.name = name
bob = Person('Bob')
width = magicattr.get(bob, 'settings["style"]["width"]')
magicattr.set(bob, 'settings["style"]["width"]', 400)- Whether the package works reliably with modern Python versions (support unspecified in metadata).
- Whether any edge cases or bugs have emerged since the last release in 2022 that users have worked around.
What it is and what it does
Magicattr extends Python's getattr and setattr to work on deeply nested structures—objects with attributes, lists, and dictionaries—by parsing a path string into an abstract syntax tree and evaluating it safely without using eval. Instead of raising a generic AttributeError, it preserves the actual failure cause, making debugging easier.
The package is useful when you need to read or write values deep within a complex object hierarchy using a single string path, such as `'friends[0].settings["style"]["width"]'`. It supports get, set, and delete operations on combinations of object attributes, list indices (including negative indexing), and dictionary keys. It explicitly blocks unsafe operations like function calls, expressions, and slicing.
Use it for
- Retrieve or modify configuration nested in dictionaries and objects without manual traversal.
- Update deeply nested properties in data models or ORM objects via a single path string.
- Delete attributes or list items at arbitrary depths in a complex object tree.
- Parse and apply user-provided paths to objects without the security risk of eval.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need safe nested attribute access and can accept an abandoned package.
The code is simple and has no dependencies, so the risk of breakage is low for stable use cases. However, do not rely on it for new projects requiring active maintenance or support for future Python versions—consider it a utility for existing codebases where the feature set is complete and stable.
Install
magicattr on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. However, the package is abandoned—last commit was 2022-02-18 and no releases since 2022-01-25, so it will not receive bug fixes or maintenance.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install magicattr
import magicattr
class Person:
settings = {'style': {'width': 200}}
def __init__(self, name):
self.name = name
bob = Person('Bob')
width = magicattr.get(bob, 'settings["style"]["width"]')
magicattr.set(bob, 'settings["style"]["width"]', 400)
Verify before relying
- Whether the package works reliably with modern Python versions (support unspecified in metadata).
- Whether any edge cases or bugs have emerged since the last release in 2022 that users have worked around.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,662 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,930,589 / month, #2,008 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: magicattr-0.1.6-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “deep object property getter”
- magicattrProvides nested attribute access and modification on objects, lists,…
- pluckyPlucky provides concise, safe access to deeply nested values in…
- chempropChemprop trains and deploys message passing neural networks to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also super-collections · pathable · flatdict · json-flatten · mulpyplexer · python-box · jsonslicer · magic-filter · slicer · dictor