$npx skillfedfor your agent

portpicker

A library to choose unique available network ports.

Worth itPyPI TestingReleased Aug 20233.4M downloads / moApache 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — portpicker-1.6.0-py3-none-any.whl
v1.6.0 · released 2023-08-15 · Python >=3.6 · 1 runtime deps: psutil

Yes, for test automation and development. The package is stable and has no known vulnerabilities, with low install friction. However, the repository is archived and unmaintained—if you encounter a bug or need a feature, you will need to fork or find an alternative. For production port coordination at scale, evaluate the included port server carefully or consider running it in a controlled test environment first.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.6 or later.
  • Race condition exists between port selection and binding; for production use, the documentation recommends running a port server daemon (included) and setting PORTSERVER_ADDRESS=@unittest-portserver.
  • Low friction install with a single runtime dependency (psutil).

License · maintenance · safety

Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), so you can use, modify, and distribute it freely in commercial and private projects without restriction.

last release 2023-08-15 (1095 days) · last repo commit 2023-08-15 · 149 stars · archived

0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,396,179 downloads/mo, #2,636 on PyPI

Verify before relying

import portpicker
test_port = portpicker.pick_unused_port()

# Or from command line:
# python3 -m portpicker $$
  • Whether the port server daemon included in the package is production-ready or still considered experimental.
  • Current state of the repository and whether critical bug fixes are still accepted despite archival status.
  • Whether the race condition between picking a port and binding to it remains acceptable for modern test workloads.
Same gist for agents: .md · .json

What it is and what it does

Portpicker is a utility for finding an unused network port on the local host. It exposes a simple `pick_unused_port()` function that returns an available port number, and can also be invoked from the command line or as a Python module. The package is designed primarily for test automation, where you need to dynamically allocate ports without conflicts.

The library depends on psutil to check port availability. The documentation acknowledges a fundamental race condition: a port may be selected as free but claimed by another process before your code binds to it. For single-threaded test runs this is usually acceptable, but for loaded test hosts running many tests concurrently, the package includes an optional port server daemon that coordinates port allocation across all processes on the host, eliminating the race condition.

Use it for

  • Allocate a unique port dynamically in unit tests that start temporary servers.
  • Obtain an available port from shell scripts without hardcoding port numbers.
  • Run a port server daemon on test infrastructure to coordinate port allocation across concurrent test processes.
  • Avoid port conflicts when spinning up multiple service instances in integration tests.

Worth the install?

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

Worth it

Yes, for test automation and development.

The package is stable and has no known vulnerabilities, with low install friction. However, the repository is archived and unmaintained—if you encounter a bug or need a feature, you will need to fork or find an alternative. For production port coordination at scale, evaluate the included port server carefully or consider running it in a controlled test environment first.

Install

portpicker on PyPI

Before you install

Low friction install with a single runtime dependency (psutil). Maintenance is inactive—the repository is archived and the last release was 2023-08-15—but the package is marked as Production/Stable and has been in use since 2015.

Requires Python 3.6 or later. Race condition exists between port selection and binding; for production use, the documentation recommends running a port server daemon (included) and setting PORTSERVER_ADDRESS=@unittest-portserver.

License in practice

Licensed under Apache 2.0 (permissive), so you can use, modify, and distribute it freely in commercial and private projects without restriction.

Quickstart

import portpicker
test_port = portpicker.pick_unused_port()

# Or from command line:
# python3 -m portpicker $$

Verify before relying

  • Whether the port server daemon included in the package is production-ready or still considered experimental.
  • Current state of the repository and whether critical bug fixes are still accepted despite archival status.
  • Whether the race condition between picking a port and binding to it remains acceptable for modern test workloads.

Package facts

LicenseApache 2.0 permissive
Python supportSupports the current Python release >=3.6
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
psutil
MaintenanceAbandoned 1,095 days since the last release
Last repo commit repository archived
First released
Downloads3,396,179 / month, #2,636 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: portpicker-1.6.0-py3-none-any.whl

Tags

Capabilities
find unused network portpick available portget free port numberport allocation testingnetwork port discoveryunused port findertest port selection
Topics
port-allocationtest-automation

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 › “find unused network port”

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

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

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also port-for · ephemeral-port-reserve · portend · uncalled · pick · pytest-socket · ping3 · cppclean · vulture · pytest-unused-fixtures