{"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,"search_vec":"'3.6':19 '3.8':16 'activ':22 'altern':33 'current':14 'data':6,27 'develop':20 'format':8,28 'human':2,30 'human-read':29 'interchang':7 'nestedtext':1 'python':18 'readabl':3,31 'regular':24 'releas':25 'requir':17 'serial':26 'similar':9 'simpler':13 'version':15 'writabl':5 'yaml':11,32","created_at":"2026-05-09T05:53:06.750045+00:00","updated_at":"2026-05-09T05:53:06.750045+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://nestedtext.org","github":"https://github.com/KenKundert/nestedtext","docs":"https://nestedtext.org","changelog":"https://github.com/KenKundert/nestedtext/blob/master/doc/releases.rst","pypi":"https://pypi.org/project/nestedtext/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}