Skip to main content

The async transformation code.

Project description


Documentation Status Travis Build Status AppVeyor Build Status Coverage Status

Welcome to unasync, a project that can transform your asynchronous code into synchronous code.

Why are we doing it? - urllib3/urllib3#1335


pip install unasync


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 place the following code.

import unasync

    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 unasync.Rule instances to unasync.cmdclass_build_py()

import unasync

    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"}),


License: Your choice of MIT or Apache License 2.0

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for unasync, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size unasync-0.5.0-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size unasync-0.5.0.tar.gz (17.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page