{"id":21491,"library":"jsonasobj2","title":"jsonasobj2","description":"Python library for converting JSON to Python objects and back, version 2. Current version 1.0.4, updated June 2023. Active development with infrequent releases.","status":"active","version":"1.0.4","language":"python","source_language":"en","source_url":"https://github.com/hsolbrig/jsonasobj2","tags":["json","objects","serialization"],"install":[{"cmd":"pip install jsonasobj2","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"jsonasobj (v1) is a separate library; jsonasobj2 changed the import path.","wrong":"from jsonasobj import JsonObj","symbol":"JsonObj","correct":"from jsonasobj2 import JsonObj"}],"quickstart":{"code":"from jsonasobj2 import JsonObj\n\n# Create a JsonObj from a dict\ndata = {'name': 'Alice', 'age': 30}\nobj = JsonObj(**data)\nprint(obj.name)  # Alice\nprint(obj.as_json())  # '{\"name\": \"Alice\", \"age\": 30}'\n\n# Convert JSON string to JsonObj\njson_str = '{\"key\": \"value\"}'\nobj2 = JsonObj.from_json(json_str)\nprint(obj2.key)  # value","lang":"python","description":"Create and manipulate JSON objects using attribute access. JsonObj wraps dict and allows dot notation."},"warnings":[{"fix":"Replace 'import jsonasobj' with 'from jsonasobj2 import JsonObj'.","message":"The old jsonasobj library is deprecated. Use jsonasobj2 for new projects.","severity":"deprecated","affected_versions":"all"},{"fix":"Use obj['class'] or setattr(obj, 'class', value) if needed.","message":"JsonObj does not support attribute names that are Python reserved words (e.g., 'class'). Use dict access instead.","severity":"gotcha","affected_versions":"all"},{"fix":"Assign the result: obj = JsonObj.from_json(json_string).","message":"JsonObj.from_json() is a class method that returns a new JsonObj. It does not modify the existing instance.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.4':16 '2':13 '2023':19 'activ':20 'back':11 'convert':5 'current':14 'develop':21 'infrequ':23 'json':6,25 'jsonasobj2':1 'june':18 'librari':3 'object':9,26 'python':2,8 'releas':24 'serial':27 'updat':17 'version':12,15","created_at":"2026-04-27T17:00:10.883428+00:00","updated_at":"2026-04-27T17:00:10.883428+00:00","problems":[{"fix":"Use: from jsonasobj2 import JsonObj","cause":"Installed jsonasobj2 but tried to import 'jsonasobj' (v1).","error":"ModuleNotFoundError: No module named 'jsonasobj'"},{"fix":"Use JsonObj.from_json(json_string) as a class method.","cause":"Calling from_json() on an instance instead of the class.","error":"AttributeError: 'JsonObj' object has no attribute 'from_json'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/hsolbrig/jsonasobj2","docs":null,"changelog":null,"pypi":"https://pypi.org/project/jsonasobj2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}