{"id":26881,"library":"data2objects","title":"data2objects","description":"A lightweight library for transforming nested dictionaries, JSON, or similar data structures into Python objects with attribute-style access. Current version 0.1.0, released in 2023. Release cadence is sporadic.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/jla-gardner/data2objects","tags":["data-transformation","object-mapping","nested-data"],"install":[{"cmd":"pip install data2objects","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"from_data","correct":"from data2objects import from_data"},{"note":"","wrong":"","symbol":"DataObject","correct":"from data2objects import DataObject"}],"quickstart":{"code":"from data2objects import from_data\n\ndata = {'name': 'Alice', 'age': 30, 'address': {'city': 'Wonderland', 'zip': '12345'}}\nobj = from_data(data)\nprint(obj.name)\nprint(obj.address.city)","lang":"python","description":"Convert a nested dict into an object with dot-access."},"warnings":[{"fix":"Use dictionary-style access (obj['key']) or sanitize keys before conversion.","message":"Keys that are not valid Python identifiers (e.g., with spaces, starting with digits) will raise AttributeError when accessed as attributes.","severity":"gotcha","affected_versions":"all"},{"fix":"Manually map list items with from_data if needed.","message":"Nested lists of dicts are not recursively converted; each dict remains a dict inside a list.","severity":"gotcha","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use getattr(obj, 'some-key') or obj['some-key'] if available.","cause":"Accessing attribute that is not a valid Python identifier (e.g., contains hyphen)","error":"AttributeError: 'DataObject' object has no attribute 'some-key'"},{"fix":"Pass a dictionary or list as the first argument: from_data(data)","cause":"Calling from_data without arguments","error":"TypeError: from_data() missing 1 required positional argument: 'data'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}