portend
TCP port monitoring and discovery
Decision gist · record as of 2026-08-14
Yes. Portend solves a common, specific problem (TCP port state checking) with a minimal dependency footprint, active maintenance, no known vulnerabilities, and a permissive license. It's well-suited for test automation, service orchestration, and deployment workflows. Install it if you need to wait for ports or discover available ones in Python or shell scripts.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low install friction: pure Python wheel with a single runtime dependency (tempora).
- Actively maintained with recent commits; last release was 2025-05-29 and the repository shows ongoing activity.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and places no significant restrictions on use, modification, or distribution in commercial or private projects.
last release 2025-05-29 (442 days) · last repo commit 2026-04-13 · 9 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 889,978 downloads/mo, #4,806 on PyPI
Alternatives
Verify before relying
pip install portend
import portend
# Wait for a port to be occupied (with 3 second timeout)
portend.occupied('www.google.com', 80, timeout=3)
# Or find an available local port
port = portend.find_available_local_port()
print(port, "is available for binding")- Whether the package handles IPv6 addresses reliably (the description mentions '::1' but does not detail IPv6 support scope)
- Performance characteristics when monitoring many ports concurrently or in rapid succession
What it is and what it does
Portend is a lightweight TCP port monitoring library that lets you wait for a port to become occupied (bound by a listener) or free (unbound), with configurable timeouts. It's commonly used in test setup, service orchestration, and deployment scripts where you need to verify that a service has started or that a port is available before binding to it.
The package provides a simple API with two main functions—`occupied()` and `free()`—plus utilities like `find_available_local_port()` to discover an unused port and a lower-level `Checker` class for more direct control. It can also be invoked as a command-line tool via `python -m portend`, making it useful in shell scripts and CI/CD pipelines. The only runtime dependency is tempora, keeping the installation footprint minimal.
Use it for
- Wait for a service to start up in integration tests before running test suites that depend on it
- Find an available local port to bind a test server without port conflicts
- Verify port availability in deployment or orchestration scripts before starting a service
- Monitor a remote port (e.g., a database or API server) to detect when it becomes available after a restart
- Implement health checks in CI/CD pipelines that need to confirm a service is listening before proceeding
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Portend solves a common, specific problem (TCP port state checking) with a minimal dependency footprint, active maintenance, no known vulnerabilities, and a permissive license. It's well-suited for test automation, service orchestration, and deployment workflows. Install it if you need to wait for ports or discover available ones in Python or shell scripts.
Install
portend on PyPI
Before you install
Low install friction: pure Python wheel with a single runtime dependency (tempora). Actively maintained with recent commits; last release was 2025-05-29 and the repository shows ongoing activity.
Requires Python 3.9 or later.
License in practice
MIT license is permissive and places no significant restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install portend
import portend
# Wait for a port to be occupied (with 3 second timeout)
portend.occupied('www.google.com', 80, timeout=3)
# Or find an available local port
port = portend.find_available_local_port()
print(port, "is available for binding")
Verify before relying
- Whether the package handles IPv6 addresses reliably (the description mentions '::1' but does not detail IPv6 support scope)
- Performance characteristics when monitoring many ports concurrently or in rapid succession
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetempora |
| Maintenance | Actively maintained 442 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 889,978 / month, #4,806 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only |
Evidence: portend-3.2.1-py3-none-any.whl
Tags
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 › “tcp port monitoring”
- portendPortend monitors TCP ports to check whether they are bound (occupied)…
- goodweConnects to GoodWe solar inverters over local network to retrieve…
- port-forport-for finds and remembers unused TCP localhost ports, useful for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also wait-for-it · port-for · ephemeral-port-reserve · portpicker · websockify · pydivert · pmd-net-proto · waiting · polling2 · tox-docker