{ "info": { "author": "Keith Byrne", "author_email": "keithmbyrne@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7" ], "description": "# KBPC\n\n![GitHub](https://img.shields.io/github/license/kmjbyrne/kbpc)\n[![PyPI version](https://badge.fury.io/py/kbpc.svg)](https://badge.fury.io/py/kbpc)\n[![Build Status](https://travis-ci.org/kmjbyrne/kbpc.svg?branch=master)](https://travis-ci.org/kmjbyrne/kbpc)\n[![Coverage Status](https://coveralls.io/repos/github/kmjbyrne/kbpc/badge.svg?branch=master)](https://coveralls.io/github/kmjbyrne/kbpc?branch=master)\n\nTable of contents\n=================\n\n\n\n* [Database](#database)\n * [Models](#models)\n * [User](#user)\n * [User Model](#user-model)\n * [User DAO](#user-dao)\n * [Serializer](#flask-alchemy-model-serializer)\n* [Common](#common)\n * [Exceptions](#exceptions)\n \n\n\n## Database\n\n\n### Models\n\n#### User Model\n\nDocs coming soon\n\n#### User DAO\n\nDocs coming soon\n\n---\n\n### Flask Alchemy Model Serializer\n\n\nTransformation was originally a series of routines written to convert FlaskAlchemy models into jsonifiable dict \nstructures. This proved to be a solution lacking elegance and evolved and eventually found its way into half a dozen \nprojects over time and eventually, then started to splinter into slightly different variations.\n\n#### Basic Usage\n\n```python\nfrom flask import jsonify\n\nfrom application.models import SomeFlaskAlchemyModel\nfrom kbpc.db.flaskalchemy import serializer\n\n# Assume the model has name and age as the model fields\nmodel = SomeFlaskAlchemyModel('John Doe', 25)\ntransformed_model = serializer.serialize(model)\n\n# This typically fails if you attempt it with the model.\njson = jsonify(data=model)\n\n# This however is serializable immediately\njson = jsonify(data=transformed_model)\n```\n\n\nOften, fields like passwords or other sensitive data should be hidden from responses or outputs. Usually this would be \nmanaged at the model class, and writing a to_dict() function or something similar, and simply not declaring the \nprotected properties of that instance.\n\n#### Protected Properties\n\n```python\nfrom flask import jsonify\n\nfrom application.models import SomeFlaskAlchemyModel\nfrom kbpc.db.flaskalchemy import serializer\n\n# Assume the model has name and age as the model fields\nmodel = SomeFlaskAlchemyModel('John Doe', 25)\ntablename = 'tablename_of_model'\nexclusions = {tablename: ['age']}\ntransformed_model = serializer.serialize(model, exclusions)\n\n# This however is serializable immediately\njson = jsonify(data=transformed_model)\n\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/kmjbyrne/kbpc", "keywords": "python library utilities", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Flask-KBPCUtils", "package_url": "https://pypi.org/project/Flask-KBPCUtils/", "platform": "", "project_url": "https://pypi.org/project/Flask-KBPCUtils/", "project_urls": { "Homepage": "https://github.com/kmjbyrne/kbpc" }, "release_url": "https://pypi.org/project/Flask-KBPCUtils/0.1.23/", "requires_dist": null, "requires_python": "", "summary": "Reusable Python code for projects", "version": "0.1.23" }, "last_serial": 5823069, "releases": { "0.1.18": [ { "comment_text": "", "digests": { "md5": "1bfad01563b719fc91ada2884b6f2436", "sha256": "d474f69e1089269b1bf0af8da28937253b93d8d3ae3f09a95dc58e3b0e331f29" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.18.tar.gz", "has_sig": false, "md5_digest": "1bfad01563b719fc91ada2884b6f2436", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9656, "upload_time": "2019-09-12T22:45:30", "url": "https://files.pythonhosted.org/packages/1e/2f/327bf3f95839c345c58b31d91cd265e7848c8ec6bea1c5c93c92a2d59b52/Flask-KBPCUtils-0.1.18.tar.gz" } ], "0.1.20": [ { "comment_text": "", "digests": { "md5": "7aba3029700fa07e5d24fcde5e21aa47", "sha256": "d89f5420427ec18e91f34468ae903b21e1d267e82eaeac374a64114005eaf13e" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.20.tar.gz", "has_sig": false, "md5_digest": "7aba3029700fa07e5d24fcde5e21aa47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2455, "upload_time": "2019-09-12T22:49:25", "url": "https://files.pythonhosted.org/packages/90/0e/ca65815e18ddf46e3d078812ee535cedb0fb24ef57af61ed76c64d672858/Flask-KBPCUtils-0.1.20.tar.gz" } ], "0.1.21": [ { "comment_text": "", "digests": { "md5": "48e2a23c36e51a6ad9737364ce5fcb59", "sha256": "575ba39d7ca3a8731266e26e93f4d778571f32809252af33c2d51e1eae6bb8d9" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.21.tar.gz", "has_sig": false, "md5_digest": "48e2a23c36e51a6ad9737364ce5fcb59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9425, "upload_time": "2019-09-12T22:57:31", "url": "https://files.pythonhosted.org/packages/96/a4/9ad355f223e84976a1a62debd5a29db4958b737ba86388189998168e6f51/Flask-KBPCUtils-0.1.21.tar.gz" } ], "0.1.22": [ { "comment_text": "", "digests": { "md5": "63988a9b717e01b4d9cca6328d57799e", "sha256": "952f101c0787ad4600ef70d205c6f97f2228951258e4594393198cbc8973165d" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.22.tar.gz", "has_sig": false, "md5_digest": "63988a9b717e01b4d9cca6328d57799e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9488, "upload_time": "2019-09-12T23:19:06", "url": "https://files.pythonhosted.org/packages/9a/02/940ec698676a36516268922aceec8ef21c2f0541909d4a29bebf010c6e18/Flask-KBPCUtils-0.1.22.tar.gz" } ], "0.1.23": [ { "comment_text": "", "digests": { "md5": "672deb4b25a327c86abe1852cb49ca1e", "sha256": "6234dd24756fca0b52ad51e71ecccab6f669f982bb80be0c1d153914ccf8bf78" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.23.tar.gz", "has_sig": false, "md5_digest": "672deb4b25a327c86abe1852cb49ca1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9494, "upload_time": "2019-09-12T23:23:55", "url": "https://files.pythonhosted.org/packages/0e/1f/157ab6f3fcd1d7568c9d8b95efb9b77020ba937f217f03cdff7385f04800/Flask-KBPCUtils-0.1.23.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "fad8ca67a7d41af83878ed577a0eb1ff", "sha256": "b867129f0988697247105fb5534277a33cb18f190ce37cbf608ea630717aef73" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.5.tar.gz", "has_sig": false, "md5_digest": "fad8ca67a7d41af83878ed577a0eb1ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2456, "upload_time": "2019-09-12T22:48:33", "url": "https://files.pythonhosted.org/packages/ec/04/7d32616e39e6de0d62ed42981b32654ba538a3cdbee72dd1963dd691498a/Flask-KBPCUtils-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "672deb4b25a327c86abe1852cb49ca1e", "sha256": "6234dd24756fca0b52ad51e71ecccab6f669f982bb80be0c1d153914ccf8bf78" }, "downloads": -1, "filename": "Flask-KBPCUtils-0.1.23.tar.gz", "has_sig": false, "md5_digest": "672deb4b25a327c86abe1852cb49ca1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9494, "upload_time": "2019-09-12T23:23:55", "url": "https://files.pythonhosted.org/packages/0e/1f/157ab6f3fcd1d7568c9d8b95efb9b77020ba937f217f03cdff7385f04800/Flask-KBPCUtils-0.1.23.tar.gz" } ] }