Skip to main content

unasync

Documentation Status Travis Build Status AppVeyor Build Status Coverage Status

Welcome to 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

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

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

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

Release files for unasync 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unasync 0.6.0
File Size Uploaded
unasync-0.6.0.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unasync 0.6.0
File Interpreter ABI Platform
unasync-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / unasync-0.6.0.tar.gz

Download URL unasync-0.6.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d01ace3e1068b20550ab15b7f9723b15b8bcde728bc1770bcb578374c7ee58
BLAKE2b-256 checksum
How to use checksums
284e735dbc0885ca197bcd80a2479ca24035627e2e768c784261fc7f1b8d7600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / unasync-0.6.0-py3-none-any.whl

Download URL unasync-0.6.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cf7aaaea9737e417d8949bf9be55dc25fdb4ef1f4edc21b58f76ff0d2b9d73f
BLAKE2b-256 checksum
How to use checksums
b8b5d2842541718ffa12060854735587543120a31ebc339435e0bd0faf368541
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page