Metadata-Version: 2.4
Name: sync-async-api
Version: 1.0.0
Summary: Interface for easy access to asynchronous methods for synchronous users
Project-URL: Homepage, https://github.com/TodWell/SyncAsync
Project-URL: Repository, https://github.com/TodWell/SyncAsync
Project-URL: Issues, https://github.com/TodWell/SyncAsync/issues
Author-email: Tobias Duewell <dev@duewell.ch>
License: MIT
Keywords: IPython,accessibility,api,asynchronous
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: nest-asyncio>=1.5
Provides-Extra: test
Requires-Dist: httpx>=0.24; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21.1; extra == 'test'
Requires-Dist: pytest>=7.4.2; extra == 'test'
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'
```