| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: aiohappyeyeballs |
| 3 |
Version: 2.4.4 |
| 4 |
Summary: Happy Eyeballs for asyncio |
| 5 |
Home-page: https://github.com/aio-libs/aiohappyeyeballs |
| 6 |
License: PSF-2.0 |
| 7 |
Author: J. Nick Koston |
| 8 |
Author-email: [email protected] |
| 9 |
Requires-Python: >=3.8 |
| 10 |
Classifier: Development Status :: 5 - Production/Stable |
| 11 |
Classifier: Intended Audience :: Developers |
| 12 |
Classifier: License :: OSI Approved :: Python Software Foundation License |
| 13 |
Classifier: License :: Other/Proprietary License |
| 14 |
Classifier: Natural Language :: English |
| 15 |
Classifier: Operating System :: OS Independent |
| 16 |
Classifier: Programming Language :: Python :: 3 |
| 17 |
Classifier: Programming Language :: Python :: 3.8 |
| 18 |
Classifier: Programming Language :: Python :: 3.9 |
| 19 |
Classifier: Programming Language :: Python :: 3.10 |
| 20 |
Classifier: Programming Language :: Python :: 3.11 |
| 21 |
Classifier: Programming Language :: Python :: 3.12 |
| 22 |
Classifier: Programming Language :: Python :: 3.13 |
| 23 |
Classifier: Topic :: Software Development :: Libraries |
| 24 |
Project-URL: Bug Tracker, https://github.com/aio-libs/aiohappyeyeballs/issues |
| 25 |
Project-URL: Changelog, https://github.com/aio-libs/aiohappyeyeballs/blob/main/CHANGELOG.md |
| 26 |
Project-URL: Documentation, https://aiohappyeyeballs.readthedocs.io |
| 27 |
Project-URL: Repository, https://github.com/aio-libs/aiohappyeyeballs |
| 28 |
Description-Content-Type: text/markdown |
| 29 |
|
| 30 |
# aiohappyeyeballs |
| 31 |
|
| 32 |
<p align="center"> |
| 33 |
<a href="https://github.com/aio-libs/aiohappyeyeballs/actions/workflows/ci.yml?query=branch%3Amain"> |
| 34 |
<img src="https://img.shields.io/github/actions/workflow/status/aio-libs/aiohappyeyeballs/ci-cd.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" > |
| 35 |
</a> |
| 36 |
<a href="https://aiohappyeyeballs.readthedocs.io"> |
| 37 |
<img src="https://img.shields.io/readthedocs/aiohappyeyeballs.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status"> |
| 38 |
</a> |
| 39 |
<a href="https://codecov.io/gh/aio-libs/aiohappyeyeballs"> |
| 40 |
<img src="https://img.shields.io/codecov/c/github/aio-libs/aiohappyeyeballs.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage"> |
| 41 |
</a> |
| 42 |
</p> |
| 43 |
<p align="center"> |
| 44 |
<a href="https://python-poetry.org/"> |
| 45 |
<img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry"> |
| 46 |
</a> |
| 47 |
<a href="https://github.com/astral-sh/ruff"> |
| 48 |
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"> |
| 49 |
</a> |
| 50 |
<a href="https://github.com/pre-commit/pre-commit"> |
| 51 |
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit"> |
| 52 |
</a> |
| 53 |
</p> |
| 54 |
<p align="center"> |
| 55 |
<a href="https://pypi.org/project/aiohappyeyeballs/"> |
| 56 |
<img src="https://img.shields.io/pypi/v/aiohappyeyeballs.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version"> |
| 57 |
</a> |
| 58 |
<img src="https://img.shields.io/pypi/pyversions/aiohappyeyeballs.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions"> |
| 59 |
<img src="https://img.shields.io/pypi/l/aiohappyeyeballs.svg?style=flat-square" alt="License"> |
| 60 |
</p> |
| 61 |
|
| 62 |
--- |
| 63 |
|
| 64 |
**Documentation**: <a href="https://aiohappyeyeballs.readthedocs.io" target="_blank">https://aiohappyeyeballs.readthedocs.io </a> |
| 65 |
|
| 66 |
**Source Code**: <a href="https://github.com/aio-libs/aiohappyeyeballs" target="_blank">https://github.com/aio-libs/aiohappyeyeballs </a> |
| 67 |
|
| 68 |
--- |
| 69 |
|
| 70 |
[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs) |
| 71 |
([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html)) |
| 72 |
|
| 73 |
## Use case |
| 74 |
|
| 75 |
This library exists to allow connecting with |
| 76 |
[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs) |
| 77 |
([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html)) |
| 78 |
when you |
| 79 |
already have a list of addrinfo and not a DNS name. |
| 80 |
|
| 81 |
The stdlib version of `loop.create_connection()` |
| 82 |
will only work when you pass in an unresolved name which |
| 83 |
is not a good fit when using DNS caching or resolving |
| 84 |
names via another method such as `zeroconf`. |
| 85 |
|
| 86 |
## Installation |
| 87 |
|
| 88 |
Install this via pip (or your favourite package manager): |
| 89 |
|
| 90 |
`pip install aiohappyeyeballs` |
| 91 |
|
| 92 |
## License |
| 93 |
|
| 94 |
[aiohappyeyeballs is licensed under the same terms as cpython itself.](https://github.com/python/cpython/blob/main/LICENSE) |
| 95 |
|
| 96 |
## Example usage |
| 97 |
|
| 98 |
```python |
| 99 |
|
| 100 |
addr_infos = await loop.getaddrinfo("example.org", 80) |
| 101 |
|
| 102 |
socket = await start_connection(addr_infos) |
| 103 |
socket = await start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2) |
| 104 |
|
| 105 |
transport, protocol = await loop.create_connection( |
| 106 |
MyProtocol, sock=socket, ...) |
| 107 |
|
| 108 |
# Remove the first address for each family from addr_info |
| 109 |
pop_addr_infos_interleave(addr_info, 1) |
| 110 |
|
| 111 |
# Remove all matching address from addr_info |
| 112 |
remove_addr_infos(addr_info, "dead::beef::") |
| 113 |
|
| 114 |
# Convert a local_addr to local_addr_infos |
| 115 |
local_addr_infos = addr_to_addr_infos(("127.0.0.1",0)) |
| 116 |
``` |
| 117 |
|
| 118 |
## Credits |
| 119 |
|
| 120 |
This package contains code from cpython and is licensed under the same terms as cpython itself. |
| 121 |
|
| 122 |
This package was created with |
| 123 |
[Copier](https://copier.readthedocs.io/) and the |
| 124 |
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template) |
| 125 |
project template. |
| 126 |
|