Metadata-Version: 2.1
Name: sync-async-api
Version: 0.1.0
Summary: Interface for easy access to asynchrneous methods for synchroneous users
License: MIT
Keywords: asynchrneous,api,IPython,accessibility
Author: Tobias Duewell
Author-email: dev@duewell.ch
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown

# SyncAsync

This library enables you to provide your asynchronous library to synchronous users,
while still enabling you, to use it as intended.

## Installation
```commandline
pip install sync-async
```

## Hello World
```python
from SyncAsync import SyncAsync

class Example(SyncAsync):

    @SyncAsync.sync
    async def hello_world(self, txt: str):
        print(txt)


        
def main(api: Example):  
    api.hello_world("Hello World")  


async def aio_main(api: Example):
    await api.hello_world("Hello Sky")

if __name__ == "__main__":
    example = Example()
    main(example)  # Prints 'Hello World'
    import asyncio
    asyncio.get_event_loop().run_until_complete(aio_main(example))  # Prints 'Hello Sky'
```
