{"id":21489,"library":"json2table","title":"json2table","description":"A library to convert JSON or Python dicts into an HTML table. Current version 1.1.5. Low release cadence.","status":"active","version":"1.1.5","language":"python","source_language":"en","source_url":"https://github.com/latture/json2table","tags":["json","html","table","conversion"],"install":[{"cmd":"pip install json2table","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"note":"Import the function directly; the module itself is not callable.","wrong":"import json2table","symbol":"convert","correct":"from json2table import convert"}],"quickstart":{"code":"from json2table import convert\n\njson_data = {\n    \"name\": \"Alice\",\n    \"age\": 30,\n    \"address\": {\n        \"street\": \"123 Maple St\",\n        \"city\": \"Springfield\"\n    }\n}\n\ntable_attributes = {\"style\": \"width:100%\"}\ntable = convert(json_data, table_attributes=table_attributes)\nprint(table)","lang":"python","description":"Basic usage: convert a nested dict to an HTML table string."},"warnings":[{"fix":"Use an OrderedDict if key order matters, or check the generated HTML order.","message":"The order of dictionary keys is not preserved. Python dicts preserve insertion order from 3.7+, but json2table may sort keys alphabetically.","severity":"breaking","affected_versions":"all"},{"fix":"Use the `max_level` parameter to limit depth or customize with `build_converter`.","message":"Nested JSON objects are expanded into sub-tables by default. This can produce deeply nested HTML if not controlled.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass a dict: {'class': 'my-table'}.","message":"The `table_attributes` parameter expects a dict, not a string. Common mistake is passing HTML attributes as a string like 'class=\"my-table\"'.","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 json2table import convert` then call `convert(data)`.","cause":"Importing the whole module and trying to call it as a function, e.g. `json2table(data)`.","error":"TypeError: 'module' object is not callable"},{"fix":"Check for local files named json2table.py and rename them. Use pip list to verify installed version.","cause":"Conflicting namespace or incorrect import path. Possibly having another module named json2table in the path.","error":"AttributeError: module 'json2table' has no attribute 'convert'"},{"fix":"Parse JSON string first: `import json; data = json.loads(json_string); convert(data)`.","cause":"Passing a JSON string instead of a Python dict. The library expects a parsed dict.","error":"TypeError: string indices must be integers"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}