{ "info": { "author": "Roman Nurik", "author_email": "roman@nurik.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "`automessage` is a library that helps you quickly create `protorpc`-based web services that interact\nwith `ndb` models (Google Cloud Datastore) by automatically generating `Message` classes for your\n`ndb.Model` subclasses, along with easy serialization/deserialization.\n\n## Caveats\n\n* This is pretty rough, alpha-level code. There are lots of TODOs. Use at your own risk.\n* This only works for Google App Engine standard environment + Python with the `protorpc` and `ndb`\n libraries.\n\n## Installation\n\n[Follow this guide](https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27)\nto install automessage as a third-party library for your App Engine Python app; the `pip` command\nyou want is:\n\n pip install -t lib/ automessage\n\n## Usage\n\nFirst, use a `@automessage.attach` decorator on your `ndb.Model` subclass:\n\n```python\nfrom google.appengine.ext import ndb\nimport automessage\n\n@automessage.attach()\nclass Book(ndb.Model):\n title = ndb.StringProperty()\n author = ndb.StringProperty()\n publish_date = ndb.DateTimeProperty(indexed=True)\n```\n\nThis generates a class `BookMessage` (a subclass of `protorpc.messages.Message`) in the same module\nas the `Book` class, that you can then use in your `protorpc`-based services, like so:\n\n```python\nclass BooksService(remote.Service):\n class FindRequest(messages.Message):\n title = messages.StringField(1, required=True)\n\n @remote.method(FindRequest, BookMessage)\n def find(self, request):\n return (Book\n .query(Book.title == request.title)\n .to_message()) # to_message() added by automessage\n\n @remote.method(BookMessage, BookMessage)\n def create(self, request):\n book = Book.from_message(request) # from_message() added by automessage\n book.put()\n return book.to_message()\n```\n\n`attach` takes several parameters (see the code for details) that lets you customize the name of the\ngenerated message class, convert to camel case, add an ID field, blacklist/whitelist properties,\netc. You can decorate models with multiple `attach` calls (with different parameters) to create\nmultiple message types for a given model. When doing so, you'll need to provide the message type\nin `to_message` calls, e.g. `book.to_message(CustomBookMessage)`.\n\n## Related work\n\n* [Protopigeon](https://github.com/theacodes/Protopigeon) is an almost identical, older approach with a slightly different API and better testing.", "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/romannurik/automessage", "keywords": "Google App Engine,GAE", "license": "", "maintainer": "", "maintainer_email": "", "name": "automessage", "package_url": "https://pypi.org/project/automessage/", "platform": "", "project_url": "https://pypi.org/project/automessage/", "project_urls": { "Homepage": "https://github.com/romannurik/automessage" }, "release_url": "https://pypi.org/project/automessage/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Automatic protorpc message types for ndb.Model subclasses (Google App Engine only)", "version": "0.1.4" }, "last_serial": 4279534, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "31c4f4fb2d6c6f72aca28c4c159091a0", "sha256": "a542c6ea52fc7acf32a6f9f67a8c97f8e96168fefa15ea3a6380789fd88af391" }, "downloads": -1, "filename": "automessage-0.1.1.tar.gz", "has_sig": false, "md5_digest": "31c4f4fb2d6c6f72aca28c4c159091a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4176, "upload_time": "2018-09-02T03:02:39", "url": "https://files.pythonhosted.org/packages/04/d8/13152b55d3393168bc31af98f3cd4ea23a0b5914ce0494d07dc7a7860af7/automessage-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6e3e3fb2be1bf843a1384f0af3ed922f", "sha256": "fda6f9b34e46f9146e750e5692a64cba8084c61c5aaead968c982cc24246a933" }, "downloads": -1, "filename": "automessage-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6e3e3fb2be1bf843a1384f0af3ed922f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5198, "upload_time": "2018-09-02T03:39:20", "url": "https://files.pythonhosted.org/packages/da/74/eea583c8e2735d6070d21dfadb67faf5368ced0dd851aa8b13126b86a135/automessage-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9792f7fda71573510e46c40fc3533403", "sha256": "d5d86d352af8e6444d18e5e21c391204abbd3c3e1b9409c7761ba05e5bcc165e" }, "downloads": -1, "filename": "automessage-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9792f7fda71573510e46c40fc3533403", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5300, "upload_time": "2018-09-17T00:37:36", "url": "https://files.pythonhosted.org/packages/7d/b0/b28347cc7140d73d5c62ad272777e2cdf1f3e2ee62aef0def96507b09b82/automessage-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8b0b13efe17984df85dae71eb5e5c590", "sha256": "66eac987011767c59a852def5da9b4e7ea8171c3114b67ed8b7c049eabfacb25" }, "downloads": -1, "filename": "automessage-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8b0b13efe17984df85dae71eb5e5c590", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5299, "upload_time": "2018-09-17T14:13:45", "url": "https://files.pythonhosted.org/packages/f1/85/eb077155bc384c627186a19196be98883cf8e32eb9a83a39c87328f0f95e/automessage-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b0b13efe17984df85dae71eb5e5c590", "sha256": "66eac987011767c59a852def5da9b4e7ea8171c3114b67ed8b7c049eabfacb25" }, "downloads": -1, "filename": "automessage-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8b0b13efe17984df85dae71eb5e5c590", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5299, "upload_time": "2018-09-17T14:13:45", "url": "https://files.pythonhosted.org/packages/f1/85/eb077155bc384c627186a19196be98883cf8e32eb9a83a39c87328f0f95e/automessage-0.1.4.tar.gz" } ] }