unasync


Nameunasync JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/python-trio/unasync
SummaryThe async transformation code.
upload_time2024-05-03 11:14:58
maintainerNone
docs_urlNone
authorRatan Kulshreshtha
requires_python>=3.8
licenseMIT OR Apache-2.0
keywords async
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            unasync
=======

|documentation| |travis| |appveyor| |codecov|

.. |travis| image:: https://travis-ci.com/python-trio/unasync.svg?branch=master
    :alt: Travis Build Status
    :target: https://travis-ci.com/python-trio/unasync

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/ovhaitunqmdd6n44/branch/master?svg=true
    :alt: AppVeyor Build Status
    :target: https://ci.appveyor.com/project/njsmith/unasync

.. |codecov| image:: https://codecov.io/gh/python-trio/unasync/branch/master/graph/badge.svg
    :alt: Coverage Status
    :target: https://codecov.io/gh/python-trio/unasync

.. |documentation| image:: https://readthedocs.org/projects/unasync/badge/?version=latest
    :alt: Documentation Status
    :target: https://unasync.readthedocs.io/en/latest/?badge=latest


Welcome to `unasync <https://pypi.org/project/unasync/>`_, a project that can transform your asynchronous code into synchronous code.

See https://github.com/urllib3/urllib3/issues/1323 for more details about unasync.

Users
=====

 * The official Elasticsearch Python client: https://github.com/elastic/elasticsearch-py
 * Hip, a HTTP client: https://github.com/python-trio/hip
 * httpcore, another low-level HTTP client uses a different implementation of the same idea: https://github.com/encode/httpcore
 
Installation
============

::

    pip install unasync

Usage
=====

To use the unasync project you need to install the package and then create a **_async** folder where you will place the asynchronous code that you want to transform into synchronous code.

And then in your :code:`setup.py` place the following code.

.. code-block:: python

    import unasync

    setuptools.setup(
        ...
        cmdclass={'build_py': unasync.cmdclass_build_py()},
        ...
    )

And when you will build your package you will get your synchronous code in **_sync** folder.

If you'd like to customize where certain rules are applied you can pass
customized :code:`unasync.Rule` instances to :code:`unasync.cmdclass_build_py()`

.. code-block:: python

    import unasync

    setuptools.setup(
        ...
        cmdclass={'build_py': unasync.cmdclass_build_py(rules=[
            # This rule transforms files within 'ahip' -> 'hip'
            # instead of the default '_async' -> '_sync'.
            unasync.Rule("/ahip/", "/hip/"),

            # This rule's 'fromdir' is more specific so will take precedent
            # over the above rule if the path is within /ahip/tests/...
            # This rule adds an additional token replacement over the default replacements.
            unasync.Rule("/ahip/tests/", "/hip/tests/", additional_replacements={"ahip": "hip"}),
        ])},
        ...
    )

Documentation
=============

https://unasync.readthedocs.io/en/latest/

License: Your choice of MIT or Apache License 2.0

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/python-trio/unasync",
    "name": "unasync",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "async",
    "author": "Ratan Kulshreshtha",
    "author_email": "ratan.shreshtha@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/28/4e/735dbc0885ca197bcd80a2479ca24035627e2e768c784261fc7f1b8d7600/unasync-0.6.0.tar.gz",
    "platform": null,
    "description": "unasync\n=======\n\n|documentation| |travis| |appveyor| |codecov|\n\n.. |travis| image:: https://travis-ci.com/python-trio/unasync.svg?branch=master\n    :alt: Travis Build Status\n    :target: https://travis-ci.com/python-trio/unasync\n\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/ovhaitunqmdd6n44/branch/master?svg=true\n    :alt: AppVeyor Build Status\n    :target: https://ci.appveyor.com/project/njsmith/unasync\n\n.. |codecov| image:: https://codecov.io/gh/python-trio/unasync/branch/master/graph/badge.svg\n    :alt: Coverage Status\n    :target: https://codecov.io/gh/python-trio/unasync\n\n.. |documentation| image:: https://readthedocs.org/projects/unasync/badge/?version=latest\n    :alt: Documentation Status\n    :target: https://unasync.readthedocs.io/en/latest/?badge=latest\n\n\nWelcome to `unasync <https://pypi.org/project/unasync/>`_, a project that can transform your asynchronous code into synchronous code.\n\nSee https://github.com/urllib3/urllib3/issues/1323 for more details about unasync.\n\nUsers\n=====\n\n * The official Elasticsearch Python client: https://github.com/elastic/elasticsearch-py\n * Hip, a HTTP client: https://github.com/python-trio/hip\n * httpcore, another low-level HTTP client uses a different implementation of the same idea: https://github.com/encode/httpcore\n \nInstallation\n============\n\n::\n\n    pip install unasync\n\nUsage\n=====\n\nTo use the unasync project you need to install the package and then create a **_async** folder where you will place the asynchronous code that you want to transform into synchronous code.\n\nAnd then in your :code:`setup.py` place the following code.\n\n.. code-block:: python\n\n    import unasync\n\n    setuptools.setup(\n        ...\n        cmdclass={'build_py': unasync.cmdclass_build_py()},\n        ...\n    )\n\nAnd when you will build your package you will get your synchronous code in **_sync** folder.\n\nIf you'd like to customize where certain rules are applied you can pass\ncustomized :code:`unasync.Rule` instances to :code:`unasync.cmdclass_build_py()`\n\n.. code-block:: python\n\n    import unasync\n\n    setuptools.setup(\n        ...\n        cmdclass={'build_py': unasync.cmdclass_build_py(rules=[\n            # This rule transforms files within 'ahip' -> 'hip'\n            # instead of the default '_async' -> '_sync'.\n            unasync.Rule(\"/ahip/\", \"/hip/\"),\n\n            # This rule's 'fromdir' is more specific so will take precedent\n            # over the above rule if the path is within /ahip/tests/...\n            # This rule adds an additional token replacement over the default replacements.\n            unasync.Rule(\"/ahip/tests/\", \"/hip/tests/\", additional_replacements={\"ahip\": \"hip\"}),\n        ])},\n        ...\n    )\n\nDocumentation\n=============\n\nhttps://unasync.readthedocs.io/en/latest/\n\nLicense: Your choice of MIT or Apache License 2.0\n",
    "bugtrack_url": null,
    "license": "MIT OR Apache-2.0",
    "summary": "The async transformation code.",
    "version": "0.6.0",
    "project_urls": {
        "Homepage": "https://github.com/python-trio/unasync"
    },
    "split_keywords": [
        "async"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8b5d2842541718ffa12060854735587543120a31ebc339435e0bd0faf368541",
                "md5": "0c5a5b3daf5b7202d5bf6bc6aa962ace",
                "sha256": "9cf7aaaea9737e417d8949bf9be55dc25fdb4ef1f4edc21b58f76ff0d2b9d73f"
            },
            "downloads": -1,
            "filename": "unasync-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c5a5b3daf5b7202d5bf6bc6aa962ace",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9959,
            "upload_time": "2024-05-03T11:14:56",
            "upload_time_iso_8601": "2024-05-03T11:14:56.170998Z",
            "url": "https://files.pythonhosted.org/packages/b8/b5/d2842541718ffa12060854735587543120a31ebc339435e0bd0faf368541/unasync-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "284e735dbc0885ca197bcd80a2479ca24035627e2e768c784261fc7f1b8d7600",
                "md5": "5af50224f21132da13a2785abad14833",
                "sha256": "a9d01ace3e1068b20550ab15b7f9723b15b8bcde728bc1770bcb578374c7ee58"
            },
            "downloads": -1,
            "filename": "unasync-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5af50224f21132da13a2785abad14833",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18755,
            "upload_time": "2024-05-03T11:14:58",
            "upload_time_iso_8601": "2024-05-03T11:14:58.312965Z",
            "url": "https://files.pythonhosted.org/packages/28/4e/735dbc0885ca197bcd80a2479ca24035627e2e768c784261fc7f1b8d7600/unasync-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-03 11:14:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "python-trio",
    "github_project": "unasync",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "unasync"
}
        
Elapsed time: 0.39433s