{"id":23184,"library":"win-inet-pton","title":"win-inet-pton","description":"Provides native inet_pton and inet_ntop implementations for Windows using ctypes. Version 1.1.0 is current; maintenance mode with rare updates.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/hickeroar/win_inet_pton","tags":["windows","inet_pton","inet_ntop","socket","compatibility","ctypes"],"install":[{"cmd":"pip install win-inet-pton","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"wrong":"from win_inet_pton import inet_pton","symbol":"inject_into_socket","correct":"from win_inet_pton import inject_into_socket"}],"quickstart":{"code":"import socket\nfrom win_inet_pton import inet_pton, inet_ntop\n\n# Monkey-patch socket module to add missing functions on Windows\nsocket.inet_pton = inet_pton\nsocket.inet_ntop = inet_ntop\n\n# Now you can use inet_pton and inet_ntop directly via socket\nprint(socket.inet_pton(socket.AF_INET, '8.8.8.8'))","lang":"python","description":"Monkey-patches socket module on Windows so inet_pton and inet_ntop work the same as on Unix."},"warnings":[{"fix":"Wrap import in a platform check.","message":"This library is Windows-only. Importing it on non-Windows systems will raise an ImportError unless you guard it. Always use the check `if sys.platform == 'win32':` before importing.","severity":"gotcha","affected_versions":"all"},{"fix":"Apply the patch in a single location, e.g., at the start of your application.","message":"The library monkey-patches the built-in socket module. If you assign the functions via `socket.inet_pton = inet_pton`, ensure you do it only once to avoid double-patching. Doing it repeatedly is harmless but confusing.","severity":"gotcha","affected_versions":"all"},{"fix":"For Python 3.4+, remove the dependency; the functions are built-in.","message":"Python 3.4+ on Windows includes official `inet_pton` support in the socket module. This library is only needed for Python 2.7 or earlier Python 3 versions. For modern Python, consider dropping it.","severity":"deprecated","affected_versions":">=3.4"}],"env_vars":null,"search_vec":"'1.1.0':18 'compat':32 'ctype':16,33 'current':20 'implement':12 'inet':3,7,10,27,29 'mainten':21 'mode':22 'nativ':6 'ntop':11,30 'provid':5 'pton':4,8,28 'rare':24 'socket':31 'updat':25 'use':15 'version':17 'win':2 'win-inet-pton':1 'window':14,26","created_at":"2026-05-01T06:02:52.048116+00:00","updated_at":"2026-05-01T06:02:52.048116+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/hickeroar/win_inet_pton","docs":null,"changelog":null,"pypi":"https://pypi.org/project/win-inet-pton/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}