Combines anyio and typer together for writing asynchronous commandlines
Project description
AnyioTyper
Wraps In Typer with Anyio, unlike Async-Typer AnyioTyper's goal is to allow customization
with different eventloops
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
anyio_typer-0.2.0.tar.gz
(7.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anyio_typer-0.2.0.tar.gz.
File metadata
- Download URL: anyio_typer-0.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2745be6c75b87241693d676e83e7d57ad9ab675c2f0ab2a5053791c4d52c3589
|
|
| MD5 |
70838eb1a6f04ccba55b79da5ac7aaa2
|
|
| BLAKE2b-256 |
e3aa1ffecb950444b798ba5b74513e5717ac53ce2db69acce523876647f5c43f
|
File details
Details for the file anyio_typer-0.2.0-py3-none-any.whl.
File metadata
- Download URL: anyio_typer-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6331fba4b731a37a4887ba983c02a31539daf11b4320df1a65355ae4cda04855
|
|
| MD5 |
d8bcab439a95358c8d79edf551f31a00
|
|
| BLAKE2b-256 |
dfac5e707210f0e58c50c571778ff09058ca87cb18ce5535dd838b71c5055d04
|