# aiohappyeyeballs
<p align="center">
<a href="https://github.com/aio-libs/aiohappyeyeballs/actions/workflows/ci.yml?query=branch%3Amain">
<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" >
</a>
<a href="https://aiohappyeyeballs.readthedocs.io">
<img src="https://img.shields.io/readthedocs/aiohappyeyeballs.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
</a>
<a href="https://codecov.io/gh/aio-libs/aiohappyeyeballs">
<img src="https://img.shields.io/codecov/c/github/aio-libs/aiohappyeyeballs.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
</a>
</p>
<p align="center">
<a href="https://python-poetry.org/">
<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">
</a>
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
</a>
<a href="https://github.com/pre-commit/pre-commit">
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
</a>
</p>
<p align="center">
<a href="https://pypi.org/project/aiohappyeyeballs/">
<img src="https://img.shields.io/pypi/v/aiohappyeyeballs.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
</a>
<img src="https://img.shields.io/pypi/pyversions/aiohappyeyeballs.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
<img src="https://img.shields.io/pypi/l/aiohappyeyeballs.svg?style=flat-square" alt="License">
</p>
---
**Documentation**: <a href="https://aiohappyeyeballs.readthedocs.io" target="_blank">https://aiohappyeyeballs.readthedocs.io </a>
**Source Code**: <a href="https://github.com/aio-libs/aiohappyeyeballs" target="_blank">https://github.com/aio-libs/aiohappyeyeballs </a>
---
[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs)
([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html))
## Use case
This library exists to allow connecting with
[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs)
([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html))
when you
already have a list of addrinfo and not a DNS name.
The stdlib version of `loop.create_connection()`
will only work when you pass in an unresolved name which
is not a good fit when using DNS caching or resolving
names via another method such as `zeroconf`.
## Installation
Install this via pip (or your favourite package manager):
`pip install aiohappyeyeballs`
## License
[aiohappyeyeballs is licensed under the same terms as cpython itself.](https://github.com/python/cpython/blob/main/LICENSE)
## Example usage
```python
addr_infos = await loop.getaddrinfo("example.org", 80)
socket = await start_connection(addr_infos)
socket = await start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2)
transport, protocol = await loop.create_connection(
MyProtocol, sock=socket, ...)
# Remove the first address for each family from addr_info
pop_addr_infos_interleave(addr_info, 1)
# Remove all matching address from addr_info
remove_addr_infos(addr_info, "dead::beef::")
# Convert a local_addr to local_addr_infos
local_addr_infos = addr_to_addr_infos(("127.0.0.1",0))
```
## Credits
This package contains code from cpython and is licensed under the same terms as cpython itself.
This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.
Raw data
{
"_id": null,
"home_page": "https://github.com/aio-libs/aiohappyeyeballs",
"name": "aiohappyeyeballs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "J. Nick Koston",
"author_email": "nick@koston.org",
"download_url": "https://files.pythonhosted.org/packages/7f/55/e4373e888fdacb15563ef6fa9fa8c8252476ea071e96fb46defac9f18bf2/aiohappyeyeballs-2.4.4.tar.gz",
"platform": null,
"description": "# aiohappyeyeballs\n\n<p align=\"center\">\n <a href=\"https://github.com/aio-libs/aiohappyeyeballs/actions/workflows/ci.yml?query=branch%3Amain\">\n <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\" >\n </a>\n <a href=\"https://aiohappyeyeballs.readthedocs.io\">\n <img src=\"https://img.shields.io/readthedocs/aiohappyeyeballs.svg?logo=read-the-docs&logoColor=fff&style=flat-square\" alt=\"Documentation Status\">\n </a>\n <a href=\"https://codecov.io/gh/aio-libs/aiohappyeyeballs\">\n <img src=\"https://img.shields.io/codecov/c/github/aio-libs/aiohappyeyeballs.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://python-poetry.org/\">\n <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\">\n </a>\n <a href=\"https://github.com/astral-sh/ruff\">\n <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\">\n </a>\n <a href=\"https://github.com/pre-commit/pre-commit\">\n <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://pypi.org/project/aiohappyeyeballs/\">\n <img src=\"https://img.shields.io/pypi/v/aiohappyeyeballs.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n </a>\n <img src=\"https://img.shields.io/pypi/pyversions/aiohappyeyeballs.svg?style=flat-square&logo=python&logoColor=fff\" alt=\"Supported Python versions\">\n <img src=\"https://img.shields.io/pypi/l/aiohappyeyeballs.svg?style=flat-square\" alt=\"License\">\n</p>\n\n---\n\n**Documentation**: <a href=\"https://aiohappyeyeballs.readthedocs.io\" target=\"_blank\">https://aiohappyeyeballs.readthedocs.io </a>\n\n**Source Code**: <a href=\"https://github.com/aio-libs/aiohappyeyeballs\" target=\"_blank\">https://github.com/aio-libs/aiohappyeyeballs </a>\n\n---\n\n[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs)\n([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html))\n\n## Use case\n\nThis library exists to allow connecting with\n[Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs)\n([RFC 8305](https://www.rfc-editor.org/rfc/rfc8305.html))\nwhen you\nalready have a list of addrinfo and not a DNS name.\n\nThe stdlib version of `loop.create_connection()`\nwill only work when you pass in an unresolved name which\nis not a good fit when using DNS caching or resolving\nnames via another method such as `zeroconf`.\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install aiohappyeyeballs`\n\n## License\n\n[aiohappyeyeballs is licensed under the same terms as cpython itself.](https://github.com/python/cpython/blob/main/LICENSE)\n\n## Example usage\n\n```python\n\naddr_infos = await loop.getaddrinfo(\"example.org\", 80)\n\nsocket = await start_connection(addr_infos)\nsocket = await start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2)\n\ntransport, protocol = await loop.create_connection(\n MyProtocol, sock=socket, ...)\n\n# Remove the first address for each family from addr_info\npop_addr_infos_interleave(addr_info, 1)\n\n# Remove all matching address from addr_info\nremove_addr_infos(addr_info, \"dead::beef::\")\n\n# Convert a local_addr to local_addr_infos\nlocal_addr_infos = addr_to_addr_infos((\"127.0.0.1\",0))\n```\n\n## Credits\n\nThis package contains code from cpython and is licensed under the same terms as cpython itself.\n\nThis package was created with\n[Copier](https://copier.readthedocs.io/) and the\n[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)\nproject template.\n\n",
"bugtrack_url": null,
"license": "PSF-2.0",
"summary": "Happy Eyeballs for asyncio",
"version": "2.4.4",
"project_urls": {
"Bug Tracker": "https://github.com/aio-libs/aiohappyeyeballs/issues",
"Changelog": "https://github.com/aio-libs/aiohappyeyeballs/blob/main/CHANGELOG.md",
"Documentation": "https://aiohappyeyeballs.readthedocs.io",
"Homepage": "https://github.com/aio-libs/aiohappyeyeballs",
"Repository": "https://github.com/aio-libs/aiohappyeyeballs"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b974fbb6559de3607b3300b9be3cc64e97548d55678e44623db17820dbd20002",
"md5": "a5ed6d247bf3bf98f9ce39ecd165978e",
"sha256": "a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8"
},
"downloads": -1,
"filename": "aiohappyeyeballs-2.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a5ed6d247bf3bf98f9ce39ecd165978e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14756,
"upload_time": "2024-11-30T18:43:39",
"upload_time_iso_8601": "2024-11-30T18:43:39.849044Z",
"url": "https://files.pythonhosted.org/packages/b9/74/fbb6559de3607b3300b9be3cc64e97548d55678e44623db17820dbd20002/aiohappyeyeballs-2.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f55e4373e888fdacb15563ef6fa9fa8c8252476ea071e96fb46defac9f18bf2",
"md5": "57d956f516c6558674f6248d8ba38321",
"sha256": "5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"
},
"downloads": -1,
"filename": "aiohappyeyeballs-2.4.4.tar.gz",
"has_sig": false,
"md5_digest": "57d956f516c6558674f6248d8ba38321",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 21977,
"upload_time": "2024-11-30T18:44:00",
"upload_time_iso_8601": "2024-11-30T18:44:00.701515Z",
"url": "https://files.pythonhosted.org/packages/7f/55/e4373e888fdacb15563ef6fa9fa8c8252476ea071e96fb46defac9f18bf2/aiohappyeyeballs-2.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-30 18:44:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aio-libs",
"github_project": "aiohappyeyeballs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aiohappyeyeballs"
}