$npx skillfedfor your agent

ephemeral-port-reserve

Bind to an ephemeral port, force it into the TIME_WAIT state, and unbind it.

With conditionsPyPI NetworkingReleased Feb 202190.2K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — ephemeral_port_reserve-1.1.4-py2.py3-none-any.whl
v1.1.4 · released 2021-02-11 · Python !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7

Yes, if you need race-free ephemeral port allocation in parallel or containerized scenarios where port 0 doesn't work. The package is lightweight, has no dependencies, carries a permissive license, and is actively maintained. Install it only if you hit the specific problem it solves; it's not a general-purpose utility.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a Unix-like system with socket support; behavior and grace period (default 60 seconds on Linux) are OS-dependent.
  • No runtime dependencies and low install friction.
  • Repository is active with recent commits (last commit 2026-04-02) and has been maintained since 2016, though the latest release was 2021-02-11.

License · maintenance · safety

MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.

last release 2021-02-11 (2010 days) · last repo commit 2026-04-02 · 70 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 90,223 downloads/mo, #13,610 on PyPI

Verify before relying

pip install ephemeral-port-reserve

from ephemeral_port_reserve import reserve
port = reserve()
print(port)  # Returns an available port number
  • Whether the package works reliably on Windows or other non-Linux systems.
  • Current test coverage and whether the race-free guarantee holds under high concurrency.
  • Whether the 60-second TIME_WAIT grace period is configurable or system-dependent only.
Same gist for agents: .md · .json

What it is and what it does

ephemeral-port-reserve solves the problem of allocating unused network ports when the standard "port 0 trick" fails or is unreliable. Some applications like mysqld or Docker interpret port 0 specially rather than letting the kernel choose a free port, and Docker's port allocation can race under parallelism. This package provides a race-free alternative by binding to an ephemeral port, forcing it into TIME_WAIT state, and unbinding it—reserving that port so the kernel won't reuse it for a grace period (typically 60 seconds on Linux), while still allowing subprocesses to bind to it explicitly if they use SO_REUSEADDR.

It's typically used in test suites, containerized deployments, and parallel service startup scenarios where you need to guarantee port availability without hard-coding. The package has no runtime dependencies, supports Python 2.7 and 3.5 through 3.8, and is maintained as a small, focused utility.

Use it for

  • Running multiple Docker containers in parallel without port conflicts by reserving ports before container startup.
  • Allocating ports for parallel test services in CI/CD pipelines where port 0 is unreliable.
  • Starting multiple instances of mysqld or similar daemons that don't honor port 0 as a kernel-allocation signal.
  • Ensuring port availability in containerized test environments where standard ephemeral allocation races.
  • Scripting port reservation for subprocess startup when you need to pass the port number to child processes.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need race-free ephemeral port allocation in parallel or containerized scenarios where port 0 doesn't work.

The package is lightweight, has no dependencies, carries a permissive license, and is actively maintained. Install it only if you hit the specific problem it solves; it's not a general-purpose utility.

Install

ephemeral-port-reserve on PyPI

Before you install

No runtime dependencies and low install friction. Repository is active with recent commits (last commit 2026-04-02) and has been maintained since 2016, though the latest release was 2021-02-11.

Requires a Unix-like system with socket support; behavior and grace period (default 60 seconds on Linux) are OS-dependent.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install ephemeral-port-reserve

from ephemeral_port_reserve import reserve
port = reserve()
print(port)  # Returns an available port number

Verify before relying

  • Whether the package works reliably on Windows or other non-Linux systems.
  • Current test coverage and whether the race-free guarantee holds under high concurrency.
  • Whether the 60-second TIME_WAIT grace period is configurable or system-dependent only.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 2,010 days since the last release
Last repo commit
First released
Downloads90,223 / month, #13,610 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: ephemeral_port_reserve-1.1.4-py2.py3-none-any.whl

Tags

Capabilities
ephemeral port allocationreserve unused portport 0 trick alternativerace-free port bindingdocker port conflictparallel service portsport reservation utility
Topics
port-allocationtesting-utilitiesdocker-support

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “ephemeral port allocation”

  • ephemeral-port-reserveReserves an ephemeral port reliably and race-free by binding, forcing…
  • port-forport-for finds and remembers unused TCP localhost ports, useful for…
  • portpickerFinds and returns an unused network port on the local host, available…

Give your agent the search over MCP, or paste the wish link into any chat.

More Networking packages

h11 With conditions
PyPI · WWW/HTTP · released Apr 2025

h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.

MITpure Python · 3.8+aging
894.9Mdownloads / mo
psutil Worth it
PyPI · Libraries · released Jan 2026

psutil retrieves real-time information about running processes and system resources (CPU, memory, disks, network, sensors) across multiple operating systems, enabling system monitoring, process profiling, and resource management.

permissive licensecompiled wheel · 3.6+
387.6Mdownloads / mo
pyOpenSSL With conditions
PyPI · Python Modules · released Aug 2026

pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.

Apache-2.0pure Python · 3.9+
294.2Mdownloads / mo
uvloop With conditions
PyPI · Networking · released Oct 2025

uvloop is a drop-in replacement for Python's built-in asyncio event loop, implemented in Cython and using libuv, that accelerates async I/O operations.

Apache-2.0compiled wheel · 3.8.1+
257.9Mdownloads / mo
execnet With conditions
PyPI · Libraries · released Nov 2025

execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.

However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…

MITpure Python · 3.8+aging
172.1Mdownloads / mo
pyzmq Worth it
PyPI · Networking · released Sep 2025

PyZMQ provides Python bindings for ZeroMQ (ØMQ), a lightweight messaging library that enables fast, asynchronous communication between distributed processes and applications.

BSD-3-Clausecompiled wheel · 3.8+
109.5Mdownloads / mo

See also port-for · portend · portpicker · grpcio-gcp · cpuset-py3 · jaraco.net · docker-compose · atomicwrites · wait-for-it · argbind