{ "info": { "author": "Hiroyuki Takagi", "author_email": "miyako.dev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only" ], "description": "Syncer\n======\n\n.. image:: https://img.shields.io/pypi/v/syncer.svg\n :target: https://pypi.python.org/pypi/syncer\n\n.. image:: https://img.shields.io/pypi/pyversions/syncer.svg\n :target: https://pypi.python.org/pypi/syncer\n\n.. image:: https://img.shields.io/travis/miyakogi/syncer.svg\n :target: https://travis-ci.org/miyakogi/syncer\n\n.. image:: https://codecov.io/github/miyakogi/syncer/coverage.svg?branch=master\n :target: https://codecov.io/github/miyakogi/syncer?branch=master\n\n\nSyncer is an async-to-sync converter for python.\n\n* PyPI: https://pypi.python.org/pypi/syncer/\n* Documentation: https://miyakogi.github.io/syncer/\n* Source code: https://github.com/miyakogi/syncer/\n\nFeatures\n========\n\nSometimes (mainly in test) we need to convert asynchronous functions to normal,\nsynchronous functions and run them synchronously. It can be done by\n``ayncio.get_event_loop().run_until_complete()``, but it's quite long...\n\nSyncer makes this conversion easy.\n\n* Convert coroutine-function (defined by ``aync def``) to normal (synchronous) function\n* Run coroutines synchronously\n* Support both ``async def`` and decorator (``@asyncio.coroutine``) style\n\nInstall\n=======\n\nAt the command line::\n\n $ pip install syncer\n\nUsage\n=====\n\nThis module has only one function: ``syncer.sync``.\n\n.. code-block:: py\n\n from syncer import sync\n async def async_fun():\n ...\n return 1\n b = sync(async_fun) # now b is synchronous\n assert 1 == b()\n\nTo test the above ``async_fun`` in asynchronous test functions:\n\n.. code-block:: py\n\n import unittest\n\n class TestA(unittest.TestCase):\n # ``sync`` can be used as decorator.\n # The decorated function becomes synchronous.\n @sync\n async def test_async_fun(self):\n self.assertEqual(await async_fun(), 1)\n\nOr, keep test functions synchronous and get results synchronously:\n\n.. code-block:: py\n\n class TestA(unittest.TestCase):\n def test_async_fun(self):\n # run coroutine and return the result\n self.assertEqual(sync(async_fun()), 1)\n # This is equivalent to below, just a shortcut\n self.assertEqual(\n asyncio.get_event_loop().run_until_complete(async_fun()), 1)\n\nMore examples/use-cases will be found in `test `_.\n\nLicense\n=======\n\n`MIT license `_\n\nCredits\n=======\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/miyakogi/syncer", "keywords": "syncer", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "syncer", "package_url": "https://pypi.org/project/syncer/", "platform": "", "project_url": "https://pypi.org/project/syncer/", "project_urls": { "Homepage": "https://github.com/miyakogi/syncer" }, "release_url": "https://pypi.org/project/syncer/1.3.0/", "requires_dist": null, "requires_python": "", "summary": "Async to sync converter", "version": "1.3.0" }, "last_serial": 2922411, "releases": { "0.1.0": [ { "comment_text": "built for Linux-4.2.0-30-lowlatency-x86_64-with-glibc2.3.4", "digests": { "md5": "93af8cfbd8f37f894109dc1dd730b554", "sha256": "d81cff3a2c5bf326e6baca379ccacba2a02bb0382b08c625c07584fd977d94b2" }, "downloads": -1, "filename": "syncer-0.1.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "93af8cfbd8f37f894109dc1dd730b554", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3058, "upload_time": "2016-02-25T13:35:46", "url": "https://files.pythonhosted.org/packages/5c/9c/1fa5223d5d505de07fbbb090f0b3c927b4834b16d26be92cc65d257cad73/syncer-0.1.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "1cd16ae97c701af22aa04a2c9f918c32", "sha256": "689e88df96f528c13e7ac0875423b64996656286d04c15ae9a9403cf18fba851" }, "downloads": -1, "filename": "syncer-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "1cd16ae97c701af22aa04a2c9f918c32", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 3506, "upload_time": "2016-02-25T13:35:51", "url": "https://files.pythonhosted.org/packages/53/98/3b8d8d87b075c6a76a1172f1b609ba3b0a0ef67bdd5eee24049fd589c6a2/syncer-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "6f2e28463c2ef0b600e57c1f5c65a004", "sha256": "0b1382546d9f5ecce058e1cbd699cecbac0d2fe464c6e9b6416c37970056160c" }, "downloads": -1, "filename": "syncer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6f2e28463c2ef0b600e57c1f5c65a004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9893, "upload_time": "2016-02-25T13:35:38", "url": "https://files.pythonhosted.org/packages/fc/80/ef9dff442f05d5f9d5de8adeef163b8c58697b7626b82e880e312bc110e8/syncer-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "built for Linux-4.2.0-34-lowlatency-x86_64-with-glibc2.3.4", "digests": { "md5": "1a84cc0d713b41b6808114ec35c04853", "sha256": "64194237bbd0f9f9a28e78a4e224a3df127d9208dee5b5d39d4087b2b4f0cc98" }, "downloads": -1, "filename": "syncer-1.0.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "1a84cc0d713b41b6808114ec35c04853", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3029, "upload_time": "2016-03-23T14:30:35", "url": "https://files.pythonhosted.org/packages/dc/02/b3b805ba6959588638a42a48b5b20b9e59ea442c03a4821e677ff2e2d55d/syncer-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "37b30f5f75c23b83206050fc14d9972d", "sha256": "24a6fb4147b43971d30d4d417e896906781743909a9306e9bf4cf9a4b00965b5" }, "downloads": -1, "filename": "syncer-1.0.0-py3.5.egg", "has_sig": false, "md5_digest": "37b30f5f75c23b83206050fc14d9972d", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 3467, "upload_time": "2016-03-23T14:30:44", "url": "https://files.pythonhosted.org/packages/61/a8/c9a32be16ff119d9bc77117ca0478d2b5e2a134ba7fd68480dcd1897b6a6/syncer-1.0.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "888c9ff903edc82fde6d2bfb9f0d8688", "sha256": "9c8db41cfc245ede61141e94e62b6a893eae78260b704f63a2f1bdb0d2ba0652" }, "downloads": -1, "filename": "syncer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "888c9ff903edc82fde6d2bfb9f0d8688", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9829, "upload_time": "2016-03-23T14:30:12", "url": "https://files.pythonhosted.org/packages/d9/d4/e33fb23c3f6c9b68f4052245d494535abb64565a2a3e50cb2d8489e895b0/syncer-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "built for Linux-4.2.0-34-lowlatency-x86_64-with-glibc2.3.4", "digests": { "md5": "7d0282fd1394b8fbd2bc9b40ab9d14ad", "sha256": "7996642a32310844d90d968aea9d4eba105c4c9519ecc1ad11fee57d13e22d85" }, "downloads": -1, "filename": "syncer-1.0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "7d0282fd1394b8fbd2bc9b40ab9d14ad", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 2982, "upload_time": "2016-03-24T12:01:08", "url": "https://files.pythonhosted.org/packages/d9/ac/58ec9a900c4d30f0aae5f7ad06c5a8d6a8492179969ac0e94f8f444a1dd5/syncer-1.0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "13bc928c5b637943a952fe7662a23b9b", "sha256": "8e33446d89e5e731fe03c68691a9d908f3c05845656ac24b25f1480ae9aafe0f" }, "downloads": -1, "filename": "syncer-1.0.1-py3.5.egg", "has_sig": false, "md5_digest": "13bc928c5b637943a952fe7662a23b9b", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 3364, "upload_time": "2016-03-24T12:01:19", "url": "https://files.pythonhosted.org/packages/e3/46/1c3581d5200495d193c9ce43a542b8d9c6531ecb9253a5756df5f41e3a54/syncer-1.0.1-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "8186b44d9a2335ac1e4b1a0c5243ad7e", "sha256": "73c47c64c2c1e3f8506b98ad1d4173b37404430394ffdb9f96812d2eeff78490" }, "downloads": -1, "filename": "syncer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8186b44d9a2335ac1e4b1a0c5243ad7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9887, "upload_time": "2016-03-24T12:00:59", "url": "https://files.pythonhosted.org/packages/98/e4/8b84f534d241edeaff929dbfcf028a4f7c0aaae2ddee039f6a0b600f976a/syncer-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "built for Linux-4.2.0-35-lowlatency-x86_64-with-glibc2.3.4", "digests": { "md5": "c8a007446e154e794b565a8e3ff30b2e", "sha256": "96b30579491700964356be9153504ccdeda09a123673553b4660872d72516c45" }, "downloads": -1, "filename": "syncer-1.0.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "c8a007446e154e794b565a8e3ff30b2e", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3011, "upload_time": "2016-04-19T08:55:36", "url": "https://files.pythonhosted.org/packages/2c/20/6ddbb609db6f990bcea86c47d1082737dac09b62be5703ee2e1ba41c2bcd/syncer-1.0.2.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "f096dae0e014bc4c84242705dc1bef5e", "sha256": "e724d3606526b153bd9130d29541a70bd4b113048eef4d803a19469103f738d4" }, "downloads": -1, "filename": "syncer-1.0.2-py3.5.egg", "has_sig": false, "md5_digest": "f096dae0e014bc4c84242705dc1bef5e", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 3365, "upload_time": "2016-04-19T08:55:59", "url": "https://files.pythonhosted.org/packages/70/90/8e6debf9bdeb709dabe74e3f897e380ec12f20308d683052f41ce5e6084d/syncer-1.0.2-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "867344c85f31155859cc385e97a9b5cc", "sha256": "3c6b4ddb18d1ad29bbdb7572f1cd0b7ad4c0fe907ccc67623b6448e49a18adce" }, "downloads": -1, "filename": "syncer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "867344c85f31155859cc385e97a9b5cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9883, "upload_time": "2016-04-19T08:55:11", "url": "https://files.pythonhosted.org/packages/3c/2d/def079f131897151530557321ce377fc6bcca1dd9cb475917f299d1fcea2/syncer-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5978778e83c182a1b5bc0070af0a7714", "sha256": "75a78eb62b6509ff76254256beec9b87f6bab82445f7396da99daecea647aa07" }, "downloads": -1, "filename": "syncer-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5978778e83c182a1b5bc0070af0a7714", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9960, "upload_time": "2016-05-10T09:44:10", "url": "https://files.pythonhosted.org/packages/62/47/6c8384f47e71be5bb3ba466dac2ae51f47aba61c1bcbe7b62938f5b3eceb/syncer-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "71e485b7853709fc78b3812451712f2c", "sha256": "0306976a360d4608def8f8f6ce4cdf52b60f91bffdcf7aa8d9486f677811d7b6" }, "downloads": -1, "filename": "syncer-1.2.0.tar.gz", "has_sig": false, "md5_digest": "71e485b7853709fc78b3812451712f2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9983, "upload_time": "2016-05-11T10:59:09", "url": "https://files.pythonhosted.org/packages/ac/d6/0407191d2da8909f36a2eef13d67071ae33638409e7db42d414addc71dbb/syncer-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "8b8e3c2106ce20307aa722897bed5a4d", "sha256": "6eb756f345388e08763f9695e7b5071b7657f0a7e809e486e3f9ca3fb4cd4d2c" }, "downloads": -1, "filename": "syncer-1.3.0.tar.gz", "has_sig": false, "md5_digest": "8b8e3c2106ce20307aa722897bed5a4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10799, "upload_time": "2017-06-03T10:14:50", "url": "https://files.pythonhosted.org/packages/8f/8d/25eb0e20d7b2b99ca667ca2fcdda0c35a24756c0040f8710808837aced9e/syncer-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b8e3c2106ce20307aa722897bed5a4d", "sha256": "6eb756f345388e08763f9695e7b5071b7657f0a7e809e486e3f9ca3fb4cd4d2c" }, "downloads": -1, "filename": "syncer-1.3.0.tar.gz", "has_sig": false, "md5_digest": "8b8e3c2106ce20307aa722897bed5a4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10799, "upload_time": "2017-06-03T10:14:50", "url": "https://files.pythonhosted.org/packages/8f/8d/25eb0e20d7b2b99ca667ca2fcdda0c35a24756c0040f8710808837aced9e/syncer-1.3.0.tar.gz" } ] }