{ "info": { "author": "Evan Borgstrom", "author_email": "eborgstrom@nerdwallet.com", "bugtrack_url": null, "classifiers": [], "description": "# Motion\n\nMotion is a high-level task dispatch & response framework for Amazon Kinesis. It is built on top of the low-level\nkinesis-python library and inspired by the task definition of Celery.\n\n**Motion is still under heavy development. Things here may change**\n\n## Usage\n\nCreate a `Motion` object:\n\n```\nfrom motion import Motion\n\ntasks = Motion(stream_name='my-kinesis-stream')\n```\n\n### Responding to tasks\n\n```\n@tasks.respond_to('my-event')\ndef my_event_handler(payload):\n # do something with payload...\n```\n\n### Dispatching tasks\n\n```\n# dispatch an event 'my-event' with the specified payload\ntasks.dispatch('my-event', {'foo': 'bar'})\n```\n\n### Running workers\n\n## Marshalling\n\nEvents and Payloads are converted into byte streams suitable for transport on a Kinesis stream via the process of\nMarshalling. Motion ships with a default JSON Marshalling class that simply converts a Python object into its JSON\nequivalent, wrapped with the event name, but the Marshalling operations can be extended to support any type of\nserialization that is desired (i.e. protobuf, avro, etc)\n\nTo implement a custom Marshal you must satisfy the following method signature:\n\n```\nclass MyMarshal(object):\n def to_native(self, payload):\n # de-serialize payload\n return event_name, event_payload\n\n def to_bytes(self, event_name, payload):\n # serialize payload\n return serialized_payload\n```\n\nThen pass an instance of your marshalling class when you create your `Motion` instance via the `marshal=` keyword.\n\n### Event names\n\nIn the basic example the `.respond_to` decorator is used with a string, since that's what the default JSON Marshal\nreturns, but since custom marshalling can return anything for the event_name during the `.to_native` call then you\ncan use whatever symbol you choose in the `.respond_to` decorator.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache 2", "maintainer": "", "maintainer_email": "", "name": "motion", "package_url": "https://pypi.org/project/motion/", "platform": "", "project_url": "https://pypi.org/project/motion/", "project_urls": null, "release_url": "https://pypi.org/project/motion/0.1.3/", "requires_dist": [ "click (<7.0,>=6.6)", "kinesis-python (<0.9,>=0.2.1)", "offspring (<1.0,>=0.1.1)", "six (<2.0,>=1.12.0)" ], "requires_python": "", "summary": "High-level library for dispatching and responding to tasks via AWS Kinesis", "version": "0.1.3" }, "last_serial": 6001724, "releases": { "0.0.1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "c82f3aa73c5e317fe7ad7cc011fbbbd7", "sha256": "632e0dba2b85bc111d9309356f2a30aabd875a0d7f1da58af2996ddb3f80315a" }, "downloads": -1, "filename": "motion-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c82f3aa73c5e317fe7ad7cc011fbbbd7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5408, "upload_time": "2019-09-09T20:17:20", "url": "https://files.pythonhosted.org/packages/f7/3b/ed248312d33c6d36c52895dd641e2bc2a4a46127d8522cea2caf205e29be/motion-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d1eb6d839bf4dc97f0a43e48a680ff2", "sha256": "41703a1a065e61d77bc7dae8d0d4a9a47099ba28a6bacd84cc75e57f63919554" }, "downloads": -1, "filename": "motion-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9d1eb6d839bf4dc97f0a43e48a680ff2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4907, "upload_time": "2019-09-09T20:17:21", "url": "https://files.pythonhosted.org/packages/f9/b9/ad6fed7659c099316711b5b3da9143c85b76a6384f11685886918a4b44da/motion-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6d21177173bf82d4816b9cde13bbd5f5", "sha256": "421ddc6f4171105c7f70604b84458d30fcd6deb5632ac8610fd54afc8ec45383" }, "downloads": -1, "filename": "motion-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6d21177173bf82d4816b9cde13bbd5f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5391, "upload_time": "2019-09-11T20:28:18", "url": "https://files.pythonhosted.org/packages/9c/e7/57beb359c6b2b9562521d717d6d849adc4e6b06c06c96469c2a1aee73226/motion-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16f67bf0cc8b9e052114a5bdc70e3a98", "sha256": "2835d0ca1b6dc23c7ba3ff3f011842ffd0e588c0c08a8b800dd60b06b1fb8cea" }, "downloads": -1, "filename": "motion-0.1.1.tar.gz", "has_sig": false, "md5_digest": "16f67bf0cc8b9e052114a5bdc70e3a98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4885, "upload_time": "2019-09-11T20:28:20", "url": "https://files.pythonhosted.org/packages/30/af/5e0a3b71e94f3ae96cc1ebb76dc9f0e67e4e42db288552c58bf0a8ab1291/motion-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "0f5599e32d06064ddd6fc33fc7bed399", "sha256": "bb0aa34de120a609b41869e9db5bc05de343e0ca093ab421e4f6d870c32f9f31" }, "downloads": -1, "filename": "motion-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0f5599e32d06064ddd6fc33fc7bed399", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5432, "upload_time": "2019-09-11T20:49:47", "url": "https://files.pythonhosted.org/packages/3c/71/22f825f56f0165cce629d50f1e715c993286c6938ae705763cf6d02ad7a0/motion-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da0a33de329cf773ce1d08f63b4cd3de", "sha256": "99c0570a5b6e2349a428ba5cd7f748fd9bea0b94604d5e20ced9a34a73a88a93" }, "downloads": -1, "filename": "motion-0.1.2.tar.gz", "has_sig": false, "md5_digest": "da0a33de329cf773ce1d08f63b4cd3de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4942, "upload_time": "2019-09-11T20:49:48", "url": "https://files.pythonhosted.org/packages/b9/29/801b0e5e2d566bb1ab75e308e1cab943a77590a744ea71adf9f93c564423/motion-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4aff479847a11e7753ea175a8991ffea", "sha256": "5d0eb99daa385fab7882b06eb5ea5d2ebfc8c05eade9f9fa1b525c156d83903e" }, "downloads": -1, "filename": "motion-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4aff479847a11e7753ea175a8991ffea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6289, "upload_time": "2019-10-20T02:58:32", "url": "https://files.pythonhosted.org/packages/95/51/63185210fc4b3e7daf4e3e73dc928d2112bf2a23c443a567fb4e6063fca7/motion-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "102e39e8d39c2396216e0b36768b4412", "sha256": "8293fa2cd89250f87d4101366ec6ee67ce53986b64cfb22f84acbcb2927076d3" }, "downloads": -1, "filename": "motion-0.1.3.tar.gz", "has_sig": false, "md5_digest": "102e39e8d39c2396216e0b36768b4412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5568, "upload_time": "2019-10-20T02:58:34", "url": "https://files.pythonhosted.org/packages/11/a9/2d3211e2852e2ca3932134db1b182d3075801c53ee2011018674fabb3168/motion-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4aff479847a11e7753ea175a8991ffea", "sha256": "5d0eb99daa385fab7882b06eb5ea5d2ebfc8c05eade9f9fa1b525c156d83903e" }, "downloads": -1, "filename": "motion-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4aff479847a11e7753ea175a8991ffea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6289, "upload_time": "2019-10-20T02:58:32", "url": "https://files.pythonhosted.org/packages/95/51/63185210fc4b3e7daf4e3e73dc928d2112bf2a23c443a567fb4e6063fca7/motion-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "102e39e8d39c2396216e0b36768b4412", "sha256": "8293fa2cd89250f87d4101366ec6ee67ce53986b64cfb22f84acbcb2927076d3" }, "downloads": -1, "filename": "motion-0.1.3.tar.gz", "has_sig": false, "md5_digest": "102e39e8d39c2396216e0b36768b4412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5568, "upload_time": "2019-10-20T02:58:34", "url": "https://files.pythonhosted.org/packages/11/a9/2d3211e2852e2ca3932134db1b182d3075801c53ee2011018674fabb3168/motion-0.1.3.tar.gz" } ] }