{"id":21492,"library":"jsoncomment","title":"JsonComment","description":"A wrapper to JSON parsers allowing comments, multiline strings and trailing commas. Current version 0.4.2, supports Python >=3.3. Suitable for config files with human-friendly JSON extensions.","status":"active","version":"0.4.2","language":"python","source_language":"en","source_url":"https://github.com/ewdurbin/jsoncomment","tags":["json","comments","config"],"install":[{"cmd":"pip install jsoncomment","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"JsonComment is the class; importing the module directly is not wrong but you need the class for usage.","wrong":"import jsoncomment","symbol":"JsonComment","correct":"from jsoncomment import JsonComment"}],"quickstart":{"code":"from jsoncomment import JsonComment\n\njson_str = '''\n{\n    \"name\": \"test\",\n    /* comment */\n    \"value\": 42\n}\n'''\nparser = JsonComment()\ndata = parser.loads(json_str)\nprint(data)","lang":"python","description":"Parse a JSON string with C-style comments."},"warnings":[{"fix":"Ensure comment syntax is not inside string literals.","message":"JsonComment does not strip comments from strings; if a string value contains '//' or '/*', it may be misinterpreted.","severity":"gotcha","affected_versions":"all"},{"fix":"Always validate output if parsing untrusted input.","message":"The library relies on Python's built-in json module; it does not validate JSON strictly and may accept malformed input.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from jsoncomment import JsonComment; parser = JsonComment(); parser.loads(...)","cause":"Importing the module directly instead of the class.","error":"AttributeError: module 'jsoncomment' has no attribute 'loads'"},{"fix":"Use: from jsoncomment import JsonComment","cause":"Incorrect import path.","error":"jsoncomment.JsonComment not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}