{"id":27982,"library":"nestedtext","title":"nestedtext","description":"Human readable and writable data interchange format, similar to YAML but simpler. Current version 3.8, requires Python >=3.6. Development is active with regular releases.","status":"active","version":"3.8","language":"python","source_language":"en","source_url":"https://github.com/KenKundert/nestedtext","tags":["serialization","data format","human-readable","YAML alternative"],"install":[{"cmd":"pip install nestedtext","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Direct import of functions is more common and idiomatic.","wrong":"import nestedtext; nestedtext.dumps()","symbol":"dumps","correct":"from nestedtext import dumps"},{"note":"Direct import avoids repeated module prefix.","wrong":"import nestedtext; nestedtext.loads()","symbol":"loads","correct":"from nestedtext import loads"}],"quickstart":{"code":"from nestedtext import dumps, loads\n\ndata = {\"name\": \"Alice\", \"age\": 30, \"pets\": [\"cat\", \"dog\"]}\nnt_string = dumps(data)\nprint(nt_string)\n# Output:\n# name: Alice\n# age: 30\n# pets:\n# - cat\n# - dog\n\n\nloaded = loads(nt_string)\nprint(loaded)\n# {'name': 'Alice', 'age': 30, 'pets': ['cat', 'dog']}","lang":"python","description":"Basic serialization and deserialization example."},"warnings":[{"fix":"Use explicit type conversion on load: int(value) to convert strings back to numbers. For booleans, use 'true'/'false' strings and map yourself.","message":"NestedText does not support all JSON types: numbers are parsed as strings and booleans are not natively supported. Dumping Python int/float will produce strings like '42' or '3.14'.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use spaces (2 or 4) consistently. Avoid tabs.","message":"The format is case-sensitive and strict about indentation. Mixing tabs and spaces or using inconsistent indentation will cause a parse error.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Wrap the top-level value in a dummy key, or ensure the file starts with a key-value pair.","cause":"The input starts with a value that is not a key-value mapping (e.g., a scalar or list at top-level). NestedText expects a mapping at top level.","error":"nestedtext.errors.NestedTextError: line 1, column 1: expected mapping or indented block"},{"fix":"Ensure each line with a colon has the format 'key: value' with a space after colon.","cause":"Input contains a bare colon not part of a key-value pair, or the key is missing.","error":"nestedtext.errors.NestedTextError: line 1, column 1: invalid character: ':'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}