{"id":9174,"library":"perky","title":"Perky Configuration Format","description":"Perky is a new, simple, and Pythonic text file format designed for configuration files, serving as an alternative to INI, TOML, and JSON. It focuses on a minimal, human-friendly syntax and explicit data type handling, supporting strings, mappings (dicts), and sequences (lists) natively, leaving other type transformations to the user. The library is lightweight, fast, written in 100% pure Python, and currently maintained with version 0.9.3, supporting Python 3.6+.","status":"active","version":"0.9.3","language":"en","source_language":"en","source_url":"https://github.com/larryhastings/perky/","tags":["configuration","file format","parser","rcfile","human-readable"],"install":[{"cmd":"pip install perky","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"For loading Perky configuration from a file.","symbol":"load","correct":"from perky import load"},{"note":"For loading Perky configuration from a string.","symbol":"loads","correct":"from perky import loads"}],"quickstart":{"code":"import perky\n\nconfig_string = \"\"\"\nname = ExampleApp\nversion = 1.0\nsettings = {\n  debug = True\n  log_level = INFO\n  features = [\n    feature_a\n    feature_b\n  ]\n}\n\"\"\"\n\nconfig = perky.loads(config_string)\n\nprint(config['name'])\nprint(config['settings']['debug'])\nprint(config['settings']['features'][0])\n\n# Example of loading from a file (if 'config.perky' existed)\n# with open('config.perky', 'w') as f:\n#     f.write(config_string)\n# file_config = perky.load('config.perky')\n# print(file_config)\n","lang":"python","description":"This quickstart demonstrates how to parse a Perky formatted string using `perky.loads`. The output will show how to access the parsed dictionary's values. Perky files support strings, dictionaries (mappings), and lists (sequences). Perky does not automatically convert values like 'True' to a boolean or '1.0' to a float; these remain as strings unless explicitly transformed by the user."},"warnings":[{"fix":"Ensure all Perky files are UTF-8 encoded. For non-UTF-8 files, read/write them with appropriate encoding and use `perky.loads()` or `perky.dumps()` with the resulting string data.","message":"The `encoding` argument was removed from `perky.load()` and `perky.loads()` in version 0.9.0. Perky now exclusively supports UTF-8 encoding for reading and writing files. If other encodings are required, users must handle the loading/saving to disk and use `loads`/`dumps` for string-to-object conversion.","severity":"breaking","affected_versions":"0.9.0+"},{"fix":"Update any custom pragma handlers or code accessing parser internals to use `parser.stack` instead of `parser.breadcrumbs`.","message":"The `Parser` attribute `breadcrumbs` was renamed to `stack` in version 0.9.1. While `breadcrumbs` remains an alias for now, it is undocumented and unsupported, and will be removed before version 1.0.","severity":"breaking","affected_versions":"0.9.1+"},{"fix":"Perky's philosophy is explicit data type handling. Implement custom conversion logic or integrate a third-party data transformation library like Marshmallow for type coercion.","message":"The entire `perky.transformation` submodule, which provided functions to convert strings to native Python types, is deprecated and no longer maintained or supported. It will be removed before version 1.0.","severity":"deprecated","affected_versions":"All versions, marked for removal before 1.0"},{"fix":"After parsing, explicitly convert string values to their desired Python types in your application code, e.g., `bool(config['settings']['debug'])` or `int(config['version'])`.","message":"Perky explicitly supports only strings, dictionaries, and lists. It does not perform automatic type inference for integers, floats, booleans, or `None`. Values like `True`, `123`, or `1.5` are parsed as strings.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install perky` to install the library.","cause":"The 'perky' library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'perky'"},{"fix":"Verify the file path and name. Ensure the file exists at the specified location or provide the correct absolute/relative path.","cause":"The file path provided to `perky.load()` does not exist or is incorrect.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'your_config.perky'"},{"fix":"Review the Perky file at the indicated line number. Ensure key-value pairs are correctly formatted, strings are properly quoted (if necessary), and container structures are valid. Pragmas (lines starting with '=') must be at the beginning of the line.","cause":"A malformed Perky syntax, often due to an unquoted '=' or other structural errors within a line.","error":"perky.errors.PerkyError: Unexpected character '=' in line ..."},{"fix":"Check the Perky file for the correct key name and structure. Use `dict.get()` with a default value to safely access optional keys, e.g., `config.get('optional_key', 'default_value')`.","cause":"Attempting to access a key in a Perky-parsed dictionary that does not exist.","error":"KeyError: 'some_key'"}]}