{ "info": { "author": "Matthew Brisebois", "author_email": "matthew@webheroes.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "License :: Other/Proprietary License", "Programming Language :: Python :: 3.5" ], "description": "\n\nRestruct is an easy light-weight formatting library that simplifies the process of representing SQL\nresults in a human readable format (JSON). Pass the restruct method your SQL results and a\nformatting structure and voila, you have turned your complex SQL result into beautiful JSON. One of\nthe best features of Restruct is squashing all the duplicate entries from SQL joins into a sub\nsection of your JSON structure.\n\n===============\n Usage examples\n===============\n\n*Lets assume we have a database with a user table that can be fetched with this query:*\n\n::\n\n SELECT id,\n first_name,\n last_name,\n email,\n age\n FROM users\n\nFormatting\n=============\n\n*Here is how you could write a simple template to turn the SQL result (list of dicts) into a\nprettier JSON structure:*\n\n::\n\n struct = {\n \"< id\": {\n \"id\": \"< id\",\n \"name\": {\n \"first\": \"< first_name\",\n \"last\": \"< last_name\",\n \"full\": \"{{first_name}} {{last_name}}\"\n },\n \"email\": \"< email\",\n \"age\": \"< age\"\n }\n }\n \n collection\t\t= Restruct.collection( )\n collection.format(struct)\n \n # Example output:\n {\n 273667: {\n \"id\": 273667,\n \"name\": {\n \"first\": \"Jeff\",\n \"last\": \"Goldbloom\",\n \"full\": \"Jeff Goldbloom\"\n },\n \"email\": \"jeff.goldbloom@example.com\",\n \"age\": 49\n },\n 93892: {\n \"id\": 93892,\n \"name\": {\n \"first\": \"Marty\",\n \"last\": \"Mcfly\",\n \"full\": \"Marty Mcfly\"\n },\n \"email\": \"marty.mcfly@example.com\",\n \"age\": 17\n },\n ...\n }\n \n\n ", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/webheroesinc/restruct", "keywords": "mysql", "license": "Dual License; GPLv3 and Proprietary", "maintainer": "", "maintainer_email": "", "name": "restruct", "package_url": "https://pypi.org/project/restruct/", "platform": "", "project_url": "https://pypi.org/project/restruct/", "project_urls": { "Homepage": "https://github.com/webheroesinc/restruct" }, "release_url": "https://pypi.org/project/restruct/0.2.7/", "requires_dist": null, "requires_python": "", "summary": "Turn SQL results into beautiful JSON structures", "version": "0.2.7" }, "last_serial": 3739824, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e122d2b91750f5959b36cf6c9e3698b6", "sha256": "213226145768bc8522f60e72e62ac84e8fb2cef8d7d814e69fd2a4ea829de728" }, "downloads": -1, "filename": "restruct-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e122d2b91750f5959b36cf6c9e3698b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3711, "upload_time": "2015-05-06T19:38:36", "url": "https://files.pythonhosted.org/packages/cd/e7/6da667c1cdd1458c71e26a57714cf4fbe951674fb0c9cd517ce73679c3f3/restruct-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1b3fcb93d2d7c03ab02c74417ca8eed8", "sha256": "4107e4487485faa0c6165284ac0560a13d0afa58ae42e884747e309257ecb875" }, "downloads": -1, "filename": "restruct-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1b3fcb93d2d7c03ab02c74417ca8eed8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4224, "upload_time": "2018-04-05T23:28:22", "url": "https://files.pythonhosted.org/packages/3c/0e/c538c586ce9ca7ab6223578192dfbfbc6f8bdae060cb77fef222c2b06ea6/restruct-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "322720d255334702a2efbe309fb1a5b2", "sha256": "5e39548f43dc3fa91fa21c8a43c3df535e1e94fa1a131edb69f497d9069af0ff" }, "downloads": -1, "filename": "restruct-0.2.1.tar.gz", "has_sig": false, "md5_digest": "322720d255334702a2efbe309fb1a5b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4429, "upload_time": "2018-04-05T23:47:26", "url": "https://files.pythonhosted.org/packages/4d/37/a94d344c342620560f26c43cc1214283842460dd4abc930e5015f9d43c71/restruct-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "9e95a916f2a9302169c941fbfa432de0", "sha256": "9655bf1a5b3293c3b597faa9ef87b3168da1d0dc4fde5324601e18e15da3b79f" }, "downloads": -1, "filename": "restruct-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9e95a916f2a9302169c941fbfa432de0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4426, "upload_time": "2018-04-05T23:49:52", "url": "https://files.pythonhosted.org/packages/d8/dd/935a2cba2e5ed01a77c4f2305fc8c8bfdd73c89f48f9a6182be70a7c44be/restruct-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "4a0bca52aaacc9e80b4492d8ddc486ad", "sha256": "926ecdf668657fab7d75589aad07917d3e59cf9bc071c4cd1a27cf4be1575f7b" }, "downloads": -1, "filename": "restruct-0.2.3.tar.gz", "has_sig": false, "md5_digest": "4a0bca52aaacc9e80b4492d8ddc486ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4470, "upload_time": "2018-04-05T23:52:07", "url": "https://files.pythonhosted.org/packages/8d/85/6c54c8585ac19660009df639e223a2bd43b927ebb86d9addc0eb90bd6e1a/restruct-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "0c7fed500907d76c1fefab50e35baafa", "sha256": "10cf35b6941427903e50450794581b23df7f79b3af60a0b9595a35c75f6e3685" }, "downloads": -1, "filename": "restruct-0.2.4.tar.gz", "has_sig": false, "md5_digest": "0c7fed500907d76c1fefab50e35baafa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4466, "upload_time": "2018-04-05T23:54:10", "url": "https://files.pythonhosted.org/packages/d7/21/c33501a0ba61208f5a78f140da28e5cb21950c3042a2649a55133bab8c1a/restruct-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "fc9f091bb2d7168a3835ad729fa0d9e3", "sha256": "6fa8d52529b51b2118f8a6729965aede96849bc5b9ffdf661077fdd445e92a34" }, "downloads": -1, "filename": "restruct-0.2.5.tar.gz", "has_sig": false, "md5_digest": "fc9f091bb2d7168a3835ad729fa0d9e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4443, "upload_time": "2018-04-06T00:12:37", "url": "https://files.pythonhosted.org/packages/58/c7/c398dae6e0e8ae47f756f553e5480fc8264fb1a02553341f610438042b1b/restruct-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "fe3090caaa4d3c8e1518fb87191f8251", "sha256": "c434295d6791db5962cd85dbcb971cff0a508ef64899e66c149c0e88aa8014b6" }, "downloads": -1, "filename": "restruct-0.2.6.tar.gz", "has_sig": false, "md5_digest": "fe3090caaa4d3c8e1518fb87191f8251", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4434, "upload_time": "2018-04-06T00:23:31", "url": "https://files.pythonhosted.org/packages/38/db/1428412d52c185de68df0bce5c4520dfed9e23bc9e3d3cf199d6e5cd2ece/restruct-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "bea130e28fae1042b6eead34922b0133", "sha256": "c1d92a11d55064670e149bffcab9a3d6bb868cde1127183e6b63590f5c642e57" }, "downloads": -1, "filename": "restruct-0.2.7.tar.gz", "has_sig": false, "md5_digest": "bea130e28fae1042b6eead34922b0133", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4429, "upload_time": "2018-04-06T02:59:18", "url": "https://files.pythonhosted.org/packages/ef/55/0cfcc514f9f3acdb5bc152f1b2b1b183d0a458634997b04e9c58959d5e82/restruct-0.2.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bea130e28fae1042b6eead34922b0133", "sha256": "c1d92a11d55064670e149bffcab9a3d6bb868cde1127183e6b63590f5c642e57" }, "downloads": -1, "filename": "restruct-0.2.7.tar.gz", "has_sig": false, "md5_digest": "bea130e28fae1042b6eead34922b0133", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4429, "upload_time": "2018-04-06T02:59:18", "url": "https://files.pythonhosted.org/packages/ef/55/0cfcc514f9f3acdb5bc152f1b2b1b183d0a458634997b04e9c58959d5e82/restruct-0.2.7.tar.gz" } ] }