{ "info": { "author": "Mosky", "author_email": "mosky.tw@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "Enhanced PyYAML\n===============\n\nIt makes PyYAML more convenient and avoids duplicate YAML data.\n\nHere is the features:\n\n- by deafult, use name of class as the `yaml_tag` of YAMLObject\n- load anchor `&` as an attribute `anchor` of YAMLObject instance\n- dump the attribute `anchor` of YAMLObject instance as the anchor `&` name\n\nInstallation\n------------\n\nYou can install it via PyPI,\n\n::\n\n sudo pip install enhancedyaml\n\nor download it manually.\n\nExamples\n--------\n\nHere is the yaml file:\n\n::\n\n # examples/enhanced_data.yaml\n\n %YAML 1.1\n ---\n examples:\n - !Example &first\n data: I am the first one.\n - !Example &second\n data: I am the second one.\n order:\n - \\*first\n - \\*second\n\nCreate an YAMLObject without specifiying `yaml_tag`\n===================================================\n\n::\n\n import enhancedyaml\n\n class Example(enhancedyaml.YAMLObject): pass\n\nLoaded YAML\n===========\n\nCode:\n\n::\n\n from pprint import pprint\n\n data = enhancedyaml.load(open('data/enhanced_data.yaml'))\n pprint(data)\n\nOutput:\n\n::\n\n {'examples': [<__main__.Example object at 0x7fa825fb4fd0>,\n\n <__main__.Example object at 0x7fa825fb4cd0>],\n 'order': [<__main__.Example object at 0x7fa825fb4fd0>,\n <__main__.Example object at 0x7fa825fb4cd0>]}\n\nContent of `data['order']`\n==========================\n\nCode:\n\n::\n\n pprint(list(example.__dict__ for example in data['order']))\n\nOutput:\n\n::\n\n [{'anchor': u'first', 'data': 'I am the first one.'},\n {'anchor': u'second', 'data': 'I am the second one.'}]\n\n`Example` has addational attribute `anchor`.\n\nDump Data Again\n===============\n\nCode:\n\n::\n\n print enhancedyaml.dump(data, default_flow_style=False)\n\nOutput:\n\n::\n\n examples:\n - &first !Example\n data: I am the first one.\n - &second !Example\n data: I am the second one.\n order:\n - \\*first\n - \\*second\n\nIt is almost same as the original YAML.\n\nDump Objects Which are Generated in Runtime\n===========================================\n\nCode:\n\n::\n\n e1 = Example()\n e2 = Example()\n e1.data = \"I don't have `anchor`.\"\n e2.data = \"I don't have `anchor`, too.\"\n es = [e1, e2, e2, e1]\n print enhancedyaml.dump(es, default_flow_style=False)\n\nOutput:\n\n::\n\n - &example002 !Example\n data: I don't have `anchor`.\n - &example001 !Example\n data: I don't have `anchor`, too.\n - \\*example001\n - \\*example002\n\nYou can find more examples in `enhancedyaml/examples` directory.\n\nHave fun!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "enhancedyaml", "package_url": "https://pypi.org/project/enhancedyaml/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/enhancedyaml/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/enhancedyaml/v0.1.1/", "requires_dist": null, "requires_python": null, "summary": "It makes it more convenient to use PyYAML.", "version": "v0.1.1" }, "last_serial": 656638, "releases": { "v0.1.1": [ { "comment_text": "", "digests": { "md5": "ddda839963ce6c8562742c5820b981d4", "sha256": "d8beb714f802b3b7962709b98bd7279ac0f1a500167e590fd949825980eaef32" }, "downloads": -1, "filename": "enhancedyaml-v0.1.1.tar.gz", "has_sig": false, "md5_digest": "ddda839963ce6c8562742c5820b981d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3127, "upload_time": "2013-05-20T21:27:40", "url": "https://files.pythonhosted.org/packages/a2/0a/d17dbc6e93b4bed8a969200e048de7d68cc254b76151a3b627950f35f3d9/enhancedyaml-v0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ddda839963ce6c8562742c5820b981d4", "sha256": "d8beb714f802b3b7962709b98bd7279ac0f1a500167e590fd949825980eaef32" }, "downloads": -1, "filename": "enhancedyaml-v0.1.1.tar.gz", "has_sig": false, "md5_digest": "ddda839963ce6c8562742c5820b981d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3127, "upload_time": "2013-05-20T21:27:40", "url": "https://files.pythonhosted.org/packages/a2/0a/d17dbc6e93b4bed8a969200e048de7d68cc254b76151a3b627950f35f3d9/enhancedyaml-v0.1.1.tar.gz" } ] }