Skip to main content

An async resolver for aiohttp that supports MDNS

Project description

https://github.com/aio-libs/aiohttp-asyncmdnsresolver/actions/workflows/ci-cd.yml/badge.svg https://codecov.io/gh/aio-libs/aiohttp-asyncmdnsresolver/branch/main/graph/badge.svg https://badge.fury.io/py/aiohttp-asyncmdnsresolver.svg https://readthedocs.org/projects/aiohttp-asyncmdnsresolver/badge/?version=latest https://img.shields.io/pypi/pyversions/aiohttp-asyncmdnsresolver.svg Matrix Room — #aio-libs:matrix.org Matrix Space — #aio-libs-space:matrix.org

Introduction

This module provides an aiohttp resolver that supports mDNS, which uses the zeroconf library to resolve mDNS queries.

For full documentation please read https://aiohttp-asyncmdnsresolver.readthedocs.io.

Installation

$ pip install aiohttp-asyncmdnsresolver

Quick start

import asyncio
import aiohttp
from aiohttp_asyncmdnsresolver.api import AsyncMDNSResolver

async def main():
    resolver = AsyncMDNSResolver()
    connector = aiohttp.TCPConnector(resolver=resolver)
    async with aiohttp.ClientSession(connector=connector) as session:
        async with session.get('http://example.com') as response:
            print(response.status)
        async with session.get('http://xxx.local.') as response:
            print(response.status)

asyncio.run(main())

API documentation

The documentation is located at https://aiohttp-asyncmdnsresolver.readthedocs.io.

Source code

The project is hosted on GitHub

Please file an issue on the bug tracker if you have found a bug or have some suggestion in order to improve the library.

Authors and License

It’s Apache 2 licensed and freely available.

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

aiohttp_asyncmdnsresolver-0.1.1.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiohttp_asyncmdnsresolver-0.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp_asyncmdnsresolver-0.1.1.tar.gz.

File metadata

File hashes

Hashes for aiohttp_asyncmdnsresolver-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8c65d4b08b42c8a260717a2766bd5967a1d437cee852a9b21f3928b5171a7c81
MD5 61abded67a0ab15ea16ea1149ca60e04
BLAKE2b-256 058309fb97705e7308f94197a09b486669696ea20f28074c14b5811a38bdedc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_asyncmdnsresolver-0.1.1.tar.gz:

Publisher: ci-cd.yml on aio-libs/aiohttp-asyncmdnsresolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiohttp_asyncmdnsresolver-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aiohttp_asyncmdnsresolver-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d04ded993e9f0e07c07a1bc687cde447d9d32e05bcf55ecbf94f63b33dcab93e
MD5 5a57c7d722d37d79ba774cbcd583fd86
BLAKE2b-256 d2d14f61508a43de82bb5c60cede3bb89cc57c5e8af7978d93ca03ad60b99368

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_asyncmdnsresolver-0.1.1-py3-none-any.whl:

Publisher: ci-cd.yml on aio-libs/aiohttp-asyncmdnsresolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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