Skip to main content

Convert python async function to a sync function for calling from a normal function in an existing event loop

Project description

a2s

Python async function to sync function, Convert python async function to a sync function for calling from a normal function in an existing event loop

Usage

import asyncio
from a2s import sync


@sync
async def an_async_func():
    print("Hello World")


def a_sync_func():
    an_async_func()
    pass


async def main():
    a_sync_func()
    pass


if __name__ == '__main__':
    asyncio.run(main())

Project details


Download files

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

Source Distribution

a2s-1.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

a2s-1.0.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file a2s-1.0.1.tar.gz.

File metadata

  • Download URL: a2s-1.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for a2s-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7af98893a6235177e3583a1b84a9639f5d69974711aa182fbe41fd2154177173
MD5 5342b344fb74eb81457c9a4ce98f3e8d
BLAKE2b-256 db78259fdbaf6006401eaf52109113e7a6e65229c9359d2a4f221363d9b4390c

See more details on using hashes here.

File details

Details for the file a2s-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: a2s-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for a2s-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8da1033832ca1d61a759cc9c5285b75ac2ea915f9038ab5114a6effcb02ad51f
MD5 bbee387760630c24091280a8c2397943
BLAKE2b-256 787db015e8169dcdc7793886923742f0ffdd4f10f908886abcb17cf75a03ccf9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page