{ "info": { "author": "Larry Hastings", "author_email": "larry@hastings.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3 :: Only" ], "description": "# perky\n\n## A friendly, easy, Pythonic text file format\n\n##### Copyright 2018-2019 by Larry Hastings\n\n\n### Overview\n\nPerky is a new, simple \"rcfile\" text file format for Python programs.\n\nThe following are Perky features:\n\n#### Perky syntax\n\nPerky configuration files look something like JSON without the\nquoting.\n\n example name = value\n example dict = {\n name = 3\n another name = 5.0\n }\n example list = [\n a\n b\n c\n ]\n # lines starting with hash are ignored\n\n # blank lines are ignored\n\n \" quoted name \" = \" quoted value \"\n\n triple quoted string = \"\"\"\n\n indenting\n is preserved\n\n the string is automatically outdented\n to the leftmost character of the ending\n triple-quote\n\n <-- aka here\n \"\"\"\n\n#### Explicit transformation is better than implicit\n\nOne possibly-surprising design choice of Perky: the only\nnatively supported values for the Perky parser are dicts,\nlists, and strings. Other commonly-used types (ints, floats,\netc) are handled using a different mechanism: _transformation._\n\nA Perky transformation takes a dict as input, and transforms\nthe contents of the dict based on a _schema_. A Perky schema\nis a dict with the same general shape as the dict produced\nby the Perky parse, but it contains dicts, lists,\nand *transformation functions*.\nIf you want *myvalue* in `{'myvalue':'3'}` to be a real integer,\ntransform it with the schema `{'myvalue': int}`.\n\n### API\n\n`perky.loads(s) -> d`\n\nParses a string containing Perky-file-format settings.\nReturns a dict.\n\n`perky.load(filename, encoding=\"utf-8\") -> d`\n\nParses a file containing Perky-file-format settings.\nReturns a dict.\n\n`perky.dumps(d) -> s`\n\nConverts a dictionary to a Perky-file-format string.\nKeys in the dictionary must all be strings. Values\nthat are not dicts, lists, or strings will be converted\nto strings using str.\nReturns a string.\n\n`perky.dump(filename, d, encoding=\"utf-8\")`\n\nConverts a dictionary to a Perky-file-format string\nusing `perky.dump`, then writes it to *filename*.\n\n`perky.map(d, fn) -> o`\n\nIterates over a dictionary. Returns a new dictionary where,\nfor every *value*:\n * if it is a dict, replace with a new dict.\n * if it is a list, replace with a new list.\n * if it is neither a dict nor a list, replace with\n `fn(value)`.\n\nThe function passed in is called a *conversion function*.\n\n`perky.transform(d, schema, default=None) -> o`\n\nRecursively transforms a Perky dict into some other\nobject (usually a dict) using the provided schema.\nReturns a new dict.\n\nA *schema* is a data structure matching the general expected\nshape of *d*, where the values are dicts, lists, and\ncallables. The transformation is similar to `perky.map()`\nexcept that individual values will have individual conversion\nfunctions. Also, a schema conversion function can be specified\nfor any value in *d*, even dicts or lists.\n\n*default* is a default conversion function. If there is a\nvalue *v* in *d* that doesn't have an equivalent entry in *schema*,\nand *v* is neither a list nor a dict, and if *default* is\na callable, *v* will be replaced with `default(v)` in the\noutput.\n\n`perky.Required`\n\nExperimental.\n\n`perky.nullable(fn) -> fn`\n\nExperimental.\n\n`perky.const(fn) -> o`\n\nExperimental.\n\n\n### TODO\n\n* Backslash quoting currently does \"whatever your version of Python does\". Perhaps this should be explicit, and parsed by Perky itself?\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/larryhastings/perky/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "perky", "package_url": "https://pypi.org/project/perky/", "platform": "", "project_url": "https://pypi.org/project/perky/", "project_urls": { "Homepage": "https://github.com/larryhastings/perky/" }, "release_url": "https://pypi.org/project/perky/0.1.2/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A simple, Pythonic file format. Same interface as the", "version": "0.1.2" }, "last_serial": 5229542, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "28873a9c0cd66a515ed5334a4f692600", "sha256": "0f895c74c3c1e3acd96a45b7f63def4df934cf786a53d950067b2e9b7bf8da4d" }, "downloads": -1, "filename": "perky-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "28873a9c0cd66a515ed5334a4f692600", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 26502, "upload_time": "2018-07-02T06:31:33", "url": "https://files.pythonhosted.org/packages/6a/58/ea119f7d0faf09927e40e696242e63e8627763bc795f3cbbf74691f1d51f/perky-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d261bfa392721980e6b81bedaae8f91", "sha256": "7e36837bcb2357caf792aa057f221e8987e55e19f80ea967b7e2a999af63b3b3" }, "downloads": -1, "filename": "perky-0.1.tar.gz", "has_sig": false, "md5_digest": "5d261bfa392721980e6b81bedaae8f91", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9667, "upload_time": "2018-07-02T06:31:35", "url": "https://files.pythonhosted.org/packages/23/60/3f9663a44fe4d74f380f7d5e976bed4e7367a6190fc6bb5f6383be778007/perky-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d3e85c0a985305634b6d8a380deb387d", "sha256": "96f39538a6482417d2a40d5beacdcef556abcf765485b218e2f014534b5f1ee3" }, "downloads": -1, "filename": "perky-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d3e85c0a985305634b6d8a380deb387d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 28205, "upload_time": "2018-07-02T07:08:20", "url": "https://files.pythonhosted.org/packages/c9/24/ec6f0d5a45f2aca233cdcd8fe1f6524964059ba75a6705b9c14dbd0b1343/perky-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebb66569739a92f80733c830d9bb9863", "sha256": "82c8002e2447b53b157ac222882302d2b6b5a2d93a03f78179dc4fc459c21334" }, "downloads": -1, "filename": "perky-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ebb66569739a92f80733c830d9bb9863", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 10458, "upload_time": "2018-07-02T07:08:21", "url": "https://files.pythonhosted.org/packages/5f/e6/18da8322e7197a1511cb57bc636a63487f12a541841b3d39383695e36aac/perky-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d7392c5b99c7a9fd1b52c4a128465bb3", "sha256": "62f3f497f3b1cc32cc93941b2ab047d319b263e7c179e138b31445ae17fa6bac" }, "downloads": -1, "filename": "perky-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d7392c5b99c7a9fd1b52c4a128465bb3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 28830, "upload_time": "2019-05-05T20:23:01", "url": "https://files.pythonhosted.org/packages/02/5a/4c30b87f8046e1a455f93661da80c22cd486308daddd0d824cb53ce2c57b/perky-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7f332e809bd339fcfbc53961c676707", "sha256": "98d5b57ce7de0b3e457ae67d3cef9b3780f36efaf084d5b4f151c4ebba006e48" }, "downloads": -1, "filename": "perky-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a7f332e809bd339fcfbc53961c676707", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 10750, "upload_time": "2019-05-05T20:23:03", "url": "https://files.pythonhosted.org/packages/db/fe/ebb9e2e161059e55114f439059f5561b324591291cd2f772ecc5a4923373/perky-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7392c5b99c7a9fd1b52c4a128465bb3", "sha256": "62f3f497f3b1cc32cc93941b2ab047d319b263e7c179e138b31445ae17fa6bac" }, "downloads": -1, "filename": "perky-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d7392c5b99c7a9fd1b52c4a128465bb3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 28830, "upload_time": "2019-05-05T20:23:01", "url": "https://files.pythonhosted.org/packages/02/5a/4c30b87f8046e1a455f93661da80c22cd486308daddd0d824cb53ce2c57b/perky-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7f332e809bd339fcfbc53961c676707", "sha256": "98d5b57ce7de0b3e457ae67d3cef9b3780f36efaf084d5b4f151c4ebba006e48" }, "downloads": -1, "filename": "perky-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a7f332e809bd339fcfbc53961c676707", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 10750, "upload_time": "2019-05-05T20:23:03", "url": "https://files.pythonhosted.org/packages/db/fe/ebb9e2e161059e55114f439059f5561b324591291cd2f772ecc5a4923373/perky-0.1.2.tar.gz" } ] }