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+.
pip install perkyVerified import paths — ran on the pinned version, not inferred.
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.
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.
Update any custom pragma handlers or code accessing parser internals to use `parser.stack` instead of `parser.breadcrumbs`.
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.
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'])`.
Run `pip install perky` to install the library.
Verify the file path and name. Ensure the file exists at the specified location or provide the correct absolute/relative path.
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.
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')`.No dependency data recorded yet.