{"id":15641314,"url":"https://github.com/aarant/pynat","last_synced_at":"2025-08-21T20:32:00.451Z","repository":{"id":57456190,"uuid":"122426137","full_name":"aarant/pynat","owner":"aarant","description":"Discover external IP addresses and NAT topologies using STUN.","archived":false,"fork":false,"pushed_at":"2022-08-21T02:18:02.000Z","size":17,"stargazers_count":74,"open_issues_count":3,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-10T10:03:50.979Z","etag":null,"topics":["nat-traversal","python","python-3","stun"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aarant.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-22T03:29:05.000Z","updated_at":"2024-11-30T02:17:30.000Z","dependencies_parsed_at":"2022-09-14T05:01:47.403Z","dependency_job_id":null,"html_url":"https://github.com/aarant/pynat","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarant%2Fpynat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarant%2Fpynat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarant%2Fpynat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarant%2Fpynat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aarant","download_url":"https://codeload.github.com/aarant/pynat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532443,"owners_count":18240792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nat-traversal","python","python-3","stun"],"created_at":"2024-10-03T11:42:10.697Z","updated_at":"2024-12-20T04:06:56.986Z","avatar_url":"https://github.com/aarant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. |pypi| image:: https://img.shields.io/pypi/v/pynat.svg\n.. _pypi: https://pypi.python.org/pypi/pynat\n.. |license| image:: https://img.shields.io/github/license/arantonitis/pynat.svg\n.. _license: https://github.com/arantonitis/pynat/tree/master/LICENSE\n\nPyNAT\n*****\n|pypi|_ |license|_\n\nDiscover external IP addresses and NAT topologies using STUN (Simple Traversal of UDP Through Network Address Translators).\n\nPyNAT follows `RFC 3489`_, and is inspired by a similar program for \nPython 2.x called PyStun_. PyNAT supports Python 2.7 and later.\n\n.. _RFC 3489: https://tools.ietf.org/html/rfc3489\n.. _PyStun: https://github.com/jtriley/pystun\n\nInstallation\n============\nPyNAT requires Python 2.7 or later.\n\nFrom PyPI\n---------\nInstall PyNAT by running ``pip3 install pynat`` from the command line.\n\n.. note::\n\n   On some Linux systems, installation may require running pip with root permissions, or running ``pip3 install pynat --user``. The latter may require exporting `~/.local/bin` to PATH.\n   \nFrom GitHub\n-----------\nClone or download the `git repo`_, navigate to the directory, and run::\n\n    python3 setup.py sdist\n    cd dist\n    pip3 install pynat-\u003cversion\u003e.tar.gz\n    \n.. _git repo: https://github.com/arantonitis/pynat\n\nUsage\n=====\nTo get information about the network topology and external IP/port used, run ``pynat``::\n\n    Network type: UDP Firewall \n    Internal address: 127.0.0.1:54320 \n    External address: 127.0.0.1:54320\n    \nRun ``pynat -h`` or ``pynat --help`` for more options::\n\n    usage: pynat [-h] [--source_ip SOURCE_IP] [--source-port SOURCE_PORT]\n                 [--stun-host STUN_HOST] [--stun-port STUN_PORT]\n\n    PyNAT v0.0.0 Discover external IP addresses and NAT topologies using STUN.\n    Copyright (C) 2018 Ariel Antonitis. Licensed under the MIT License.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --source_ip SOURCE_IP\n                            The source IPv4/IPv6 address to bind to.\n      --source-port SOURCE_PORT\n                            The source port to bind to.\n      --stun-host STUN_HOST\n                            The STUN host to use for queries.\n      --stun-port STUN_PORT\n                            The port of the STUN host to use for queries.\n                          \nTo use PyNAT inside a Python shell or project::\n\n    from pynat import get_ip_info\n    topology, ext_ip, ext_port = get_ip_info()\n    \nTo also get information about the internal IP, if unknown::\n\n    topology, ext_ip, ext_port, int_ip = get_ip_info(include_internal=True)\n    \nDevelopment\n===========\nPyNAT versioning functions on a ``MAJOR.MINOR.PATCH.[DEVELOP]`` model. Only stable, non development releases will be published to PyPI. Because PyNAT is still a beta project, the ``MAJOR`` increment will be 0. Minor increments represent new features. Patch increments represent problems fixed with existing features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarant%2Fpynat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faarant%2Fpynat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarant%2Fpynat/lists"}