P

python/eliminate-async-io

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

This codemod transforms an asynchronous Python code into synchronous code by removing or modifying specific async and await patterns.

This codemod eliminates import asyncio statements, removes await expressions, unwraps asyncio.run() calls, and converts async def function definitions to synchronous def function definitions. This can be useful in environments where async functionality is not supported or not required.

Examples

Before

python

After

python

Before

python

After

python

Ready to contribute?

Build your own codemod and share it with the community.