{"categories":[{"label":"Systems Administration","url":"https://skillfed.io/packages/category/system-systems-administration"},{"label":"Installation/Setup","url":"https://skillfed.io/packages/category/system-installation-setup"},{"label":"Site Management","url":"https://skillfed.io/packages/category/internet-www-http-site-management"}],"enrichment":{"capability":"port-for finds and remembers unused TCP localhost ports, useful for persistent port allocation across service restarts and multi-component software stacks.","skillfed_tags":["port-management","cli-utility","local-development"],"use_cases":["Allocate persistent ports for multiple services in a local development stack without manual port assignment.","Ensure service restarts use the same port by querying the stored association via the command-line tool.","Programmatically select safe ports in test suites or deployment scripts that need to avoid OS-assigned ephemeral ranges.","Configure multi-tenant or multi-site setups on a single server by naming ports with conventions (e.g., 'example.com/apache').","Build port management into installation scripts that need to find available ports without manual intervention."],"what_it_does":"port-for is a command-line utility and Python library that selects and persists unused TCP localhost ports. Unlike socket.bind((host, 0)), which returns temporary OS-assigned ports, port-for finds ports that are less likely to be claimed by the operating system or other services, making it suitable for durable service configurations across restarts.\n\nThe library applies several heuristics: it verifies ports are unused by attempting to connect and bind, excludes IANA-assigned and well-known ports, avoids ephemeral port ranges (which the OS may reclaim), and prefers ports from larger ranges away from well-known services. It can store port-to-name associations in a configuration file, allowing subsequent calls to return the same port for a given service name.","worth_installing":"Yes. port-for solves a real problem\u2014persistent, safe port allocation\u2014with no dependencies, active maintenance, MIT licensing, and no known vulnerabilities. It is well-suited for development stacks, testing frameworks, and deployment automation. The only caveat is that the command-line tool requires sudo to create new associations, which may limit its use in restricted environments."},"id":"port-for","links":{"html":"https://skillfed.io/packages/port-for","md":"https://skillfed.io/packages/port-for.md","pypi":"https://pypi.org/project/port-for/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-30","license_spdx":null,"license_treatment":"permissive","name":"port-for","python_support":"supports_current","summary":"Utility that helps with local TCP ports management. It can find an unused TCP localhost port and remember the association."},"popularity":{"monthly_downloads":7385441,"position":1746,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.0.0"}
