{ "info": { "author": "Patrick Hensley", "author_email": "spaceboy@indirect.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "python-wax - hierarchical configuration format and context object for Python\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nQuick Example\n~~~~~~~~~~~~~\n\n::\n\n >>> from wax import Wax, parse_wax\n >>> w = Wax(server=Wax(host='localhost'))\n >>> w.server.port = 1234\n\n >>> print 'hostname is %(server.host)s using port %(server.port)s' % w\n hostname is localhost using port 1234\n\n >>> s = str(w)\n >>> print s\n\n [server]\n host = \"localhost\"\n port = 1234\n\n >>> w = parse_wax(s)\n print w\n\n [server]\n host = \"localhost\"\n port = 1234\n\nFeatures\n~~~~~~~~\n\n- Context objects can be serialized to / from string\n- Simple hierarchical key structure\n- Key order is maintained\n- Values can be any JSON type\n- Supports comments and annotations\n\nOverview\n~~~~~~~~\n\nEasy to construct in code:\n\n::\n\n >>> w = Wax(message='hello world', num=17)\n\nAccess values with indexes:\n\n::\n\n >>> w['num'] = 18\n\n.. or as properties:\n\n::\n\n >>> w.message = 'hello again'\n\n.. or using get, with optional default value:\n\n::\n\n >>> w.get('missing.key', 'no problem')\n 'no problem'\n\nThis object translates directly to a file format. Reading the format\nwill reconstruct the context object exactly. This allows for\n\"round-trip\" configuration that can be serialized to utf-8, edited, and\nread back in:\n\n::\n\n >>> w = Wax(state='New York', zip=10003)\n >>> s = str(w)\n >>> print s\n state = \"New York\"\n zip = 10003\n\n >>> q = parse_wax(s)\n >>> print q\n state = \"New York\"\n zip = 10003\n\nKey order is preserved when keys are added individually. If you add them\nin the constructor, initial order is governed by kwargs (dict) hashing\norder:\n\n::\n\n >>> w = Wax(a=1, b=2, c=3)\n >>> print w\n a = 1\n c = 3\n b = 2\n\n >>> w = Wax()\n >>> w.a = 1\n >>> w.b = 2\n >>> w.c = 3\n >>> print w\n a = 1\n b = 2\n c = 3\n\nCreate sublevels by attaching a Wax instance to a key:\n\n::\n\n >>> w = Wax(level1=Wax(level2=Wax(property='value')))\n\n.. which is equivalent to:\n\n::\n\n >>> w = Wax()\n >>> w.level1 = Wax()\n >>> w.level1.level2 = Wax()\n >>> w.level1.level2.property = 'value'\n\nSerializing this:\n\n::\n\n >>> print w\n [level1.level2]\n property = \"value\"\n\nOr you can set dotted keys to create nested values:\n\n::\n\n >>> w = Wax()\n >>> w['foo.bar'] = 123\n >>> print w.foo.bar\n 123\n\nDotted access can be used in formatting strings:\n\n::\n\n >>> w = Wax(server=Wax(host='localhost', port=1234))\n >>> print 'hostname is %(server.host)s using port %(server.port)s' % w\n hostname is localhost using port 1234", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/phensley/python-wax", "keywords": "config,configuration,json,ini", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "python-wax", "package_url": "https://pypi.org/project/python-wax/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-wax/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/phensley/python-wax" }, "release_url": "https://pypi.org/project/python-wax/0.3/", "requires_dist": null, "requires_python": null, "summary": "A hierarchical configuration format and context object for Python", "version": "0.3" }, "last_serial": 1245997, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c547cb48f7d1480a2482719fda0ed555", "sha256": "fcaa90ee1240b4399084ffae6a1e7fb6c8d4425fc66982cda5a517a08b1aaeeb" }, "downloads": -1, "filename": "python-wax-0.1.tar.gz", "has_sig": false, "md5_digest": "c547cb48f7d1480a2482719fda0ed555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14450, "upload_time": "2014-10-02T15:51:28", "url": "https://files.pythonhosted.org/packages/9c/db/789a96452dd596797a735471ab17190d28b2bbc91b056390cf5e7c514ea8/python-wax-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "477b140ae65c07a46564b73376054d0e", "sha256": "a7269da5b88474fda5cd584eebe534fb4120052ac4fa2de95c9da1c3f17515fe" }, "downloads": -1, "filename": "python-wax-0.2.tar.gz", "has_sig": false, "md5_digest": "477b140ae65c07a46564b73376054d0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14451, "upload_time": "2014-10-02T16:14:10", "url": "https://files.pythonhosted.org/packages/ec/9a/abe9080396b39f5105c1d40dcb1e6e657a455142d610cde3d47f3aaaa4ce/python-wax-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "b648cbc30733ec32fbf47723c05dcd1e", "sha256": "ced3fa933b9619d812067f6d765dda169cea9b2b54b9ca0bb64dfa1b7a99247a" }, "downloads": -1, "filename": "python-wax-0.3.tar.gz", "has_sig": false, "md5_digest": "b648cbc30733ec32fbf47723c05dcd1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15680, "upload_time": "2014-10-02T16:17:32", "url": "https://files.pythonhosted.org/packages/9e/16/6e057f20dbb18b33d054809b0847aad11366aae19b9038e3945b137cb2a2/python-wax-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b648cbc30733ec32fbf47723c05dcd1e", "sha256": "ced3fa933b9619d812067f6d765dda169cea9b2b54b9ca0bb64dfa1b7a99247a" }, "downloads": -1, "filename": "python-wax-0.3.tar.gz", "has_sig": false, "md5_digest": "b648cbc30733ec32fbf47723c05dcd1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15680, "upload_time": "2014-10-02T16:17:32", "url": "https://files.pythonhosted.org/packages/9e/16/6e057f20dbb18b33d054809b0847aad11366aae19b9038e3945b137cb2a2/python-wax-0.3.tar.gz" } ] }