Metadata-Version: 2.4
Name: anyio-typer
Version: 0.2.0
Summary: Combines anyio and typer together for writing asynchronous commandlines
Author-email: Vizonex <VizonexBusiness@gmail.com>
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.16.0
Requires-Dist: anyio>=4.12.1
Requires-Dist: typing-extensions; python_version < "3.11"
Provides-Extra: trio
Requires-Dist: trio>=0.30.0; extra == "trio"
Provides-Extra: uvloop
Requires-Dist: uvloop>=0.21.0; sys_platform != "win32" and extra == "uvloop"
Requires-Dist: winloop>=0.2.2; sys_platform == "win32" and extra == "uvloop"
Dynamic: license-file

# AnyioTyper
Wraps In Typer with Anyio, unlike `Async-Typer` AnyioTyper's goal is to allow customization 
with different eventloops 

```python
from anyio_typer import AnyioTyper, Option
from typing import Annotated
app = AnyioTyper()

# This example uses a library called cyares you can install it with `pip install cyares`

# NOTE: winloop is supported by default if your on a windows operating system
@app.uvloop_command()
async def uvloop(
    host:str,
    rt:Annotated[str, Option(help="A Type of record to uncover", show_default=True)] = "A" 
    ):
    """Use Uvloop or Winloop for DNS Resolving"""
    
    from cyares.aio import DNSResolver

    async with DNSResolver(["8.8.8.8", "8.8.4.4"]) as resolver:
        result = await resolver.query(host, rt)
    print(result)

@app.trio_command()
async def trio(
    host:str,
    rt:Annotated[str, Option(help="A Type of record to uncover", show_default=True)] = "A" 
    ):
    """Use Trio for DNS Resolving"""
    from cyares.trio import DNSResolver

    async with DNSResolver(["8.8.8.8", "8.8.4.4"]) as resolver:
        result = await resolver.query(host, rt)
    print(result)


if __name__ == "__main__":
    app()
```
