{"id":13433301,"url":"https://github.com/ncrocfer/whatportis","last_synced_at":"2025-05-15T15:05:16.361Z","repository":{"id":62588800,"uuid":"50464877","full_name":"ncrocfer/whatportis","owner":"ncrocfer","description":"Whatportis : explore IANA's list of ports","archived":false,"fork":false,"pushed_at":"2023-05-23T00:51:55.000Z","size":580,"stargazers_count":687,"open_issues_count":1,"forks_count":68,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-31T19:09:21.569Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","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/ncrocfer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-26T22:45:41.000Z","updated_at":"2025-02-26T18:45:32.000Z","dependencies_parsed_at":"2022-11-03T17:48:27.139Z","dependency_job_id":"7e11f2bb-dab3-4a19-a5b8-25d1346ffc9b","html_url":"https://github.com/ncrocfer/whatportis","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":"0.19565217391304346","last_synced_commit":"59a1718bf7c531f2a5a4e213cad0c047ce9c1c94"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fwhatportis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fwhatportis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fwhatportis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fwhatportis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncrocfer","download_url":"https://codeload.github.com/ncrocfer/whatportis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721898,"owners_count":20985084,"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":["python"],"created_at":"2024-07-31T02:01:23.833Z","updated_at":"2025-04-07T20:09:50.272Z","avatar_url":"https://github.com/ncrocfer.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"whatportis\n==========\n\n.. image:: https://github.com/opencve/opencve/workflows/Tests/badge.svg\n   :target: https://github.com/ncrocfer/whatportis/actions/workflows/tests.yml\n\n.. image:: https://badge.fury.io/py/whatportis.svg\n   :target: https://pypi.python.org/pypi/whatportis/\n\n.. image:: https://img.shields.io/badge/python-3.6%2B-blue.svg\n   :target: https://pypi.python.org/pypi/whatportis/\n\n.. image:: https://img.shields.io/github/license/ncrocfer/whatportis.svg\n   :target: https://github.com/ncrocfer/whatportis/blob/master/LICENSE.txt\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/python/black\n\nIt's a common task to search the default port number of a service. Some ports are available in the :code:`/etc/services` file, but the list is not complete and this solution is not portable.\n\nWhatportis is a simple tool that downloads the `Iana.org \u003chttp://www.iana.org/assignments/port-numbers\u003e`_ database and uses it to explore the official list of ports.\n\nUsage\n-----\n\nWhatportis allows you to find what port is associated with a service:\n\n.. code-block:: shell\n\n    $ whatportis redis\n    +-------+------+----------+---------------------------------------+\n    | Name  | Port | Protocol | Description                           |\n    +-------+------+----------+---------------------------------------+\n    | redis | 6379 |   tcp    | An advanced key-value cache and store |\n    +-------+------+----------+---------------------------------------+\n\nOr, conversely, what service is associated with a port number:\n\n.. code-block:: shell\n\n    $ whatportis 5432\n    +------------+------+----------+---------------------+\n    | Name       | Port | Protocol | Description         |\n    +------------+------+----------+---------------------+\n    | postgresql | 5432 | tcp, udp | PostgreSQL Database |\n    +------------+------+----------+---------------------+\n\nYou can also search a pattern without knowing the exact name by adding the :code:`--like` option:\n\n.. code-block:: shell\n\n    $ whatportis mysql --like\n    +----------------+-------+----------+-----------------------------------+\n    | Name           |  Port | Protocol | Description                       |\n    +----------------+-------+----------+-----------------------------------+\n    | mysql-cluster  |  1186 | tcp, udp | MySQL Cluster Manager             |\n    | mysql-cm-agent |  1862 | tcp, udp | MySQL Cluster Manager Agent       |\n    | mysql-im       |  2273 | tcp, udp | MySQL Instance Manager            |\n    | mysql          |  3306 | tcp, udp | MySQL                             |\n    | mysql-proxy    |  6446 | tcp, udp | MySQL Proxy                       |\n    | mysqlx         | 33060 |   tcp    | MySQL Database Extended Interface |\n    +----------------+-------+----------+-----------------------------------+\n\nInstallation\n------------\n\n.. code-block:: shell\n\n    $ pip install whatportis\n\nDatabase Sync\n-------------\n\nWhatportis uses a local JSON file (:code:`~/.whatportis_db.json`) to explore the list of ports. The first usage will create it for you, then you can use the :code:`--update` option to synchronize it :\n\n.. code-block:: shell\n\n    $ whatportis --update\n    Previous database will be updated, do you want to continue? [y/N]: y\n    Downloading https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv...\n    Populating database...\n    14145 ports imported.\n\nJSON output\n-----------\n\nYou can display the results as JSON, using the :code:`--json` option :\n\n.. code-block:: shell\n\n    $ whatportis 5432 --json\n    [\n        {\n            \"name\": \"postgresql\",\n            \"port\": \"5432\",\n            \"protocol\": \"tcp, udp\",\n            \"description\": \"PostgreSQL Database\"\n        }\n    ]\n\nREST API\n--------\n\nWhatportis can also be started as a RESTful API server. This feature is not enabled by default, you must install an extra package :\n\n.. code-block:: shell\n\n    $ pip install whatportis[server]\n    $ whatportis --server localhost 8080\n     * Serving Flask app \"whatportis.server\" (lazy loading)\n     * Environment: prod\n     * Debug mode: off\n     * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)\n\nThe endpoints are :code:`/ports` for the whole list (can be long) and :code:`/ports/\u003csearch\u003e` to search a specific port :\n\n.. code-block:: shell\n\n    $ curl http://127.0.0.1:8080/ports/3306\n    {\"ports\":[{\"description\":\"MySQL\",\"name\":\"mysql\",\"port\":\"3306\",\"protocol\":\"tcp, udp\"}]}\n\n    $ curl http://localhost:8080/ports/redis\n    {\"ports\":[{\"description\":\"An advanced key-value cache and store\",\"name\":\"redis\",\"port\":\"6379\",\"protocol\":\"tcp\"}]}\n\nYou can use the :code:`?like` parameter to search a pattern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrocfer%2Fwhatportis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncrocfer%2Fwhatportis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrocfer%2Fwhatportis/lists"}