get-port
Get an available port. Checks first for preferred port in case its available, if not returns random. Python implementation of the get-port idea by @sindresorhus.
Installation.
Available via PyPI.
pip install get-port
Usage.
Available in terminal:
get-port [preferred-port-optional]
Usage in code:
# Gets the actual port. Send preferred_port to pick if available.
from get_port import get_port
port = get_port(preferred_port)
# Check if port is available. Returns tuple: (Boolean, Dict)
from get_port import port_available
is_available = port_available(your_port)
# Find random free port. Returns tuple: (Port, Dict)
from get_port import find_free_port
port = find_free_port()
License
MIT.
Metadata
Release files for get-port 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| get-port-0.0.5.tar.gz | 3.7 kB | Without provenance | Details for get-port-0.0.5.tar.gz |
Release files / get-port-0.0.5.tar.gz
| Download URL | get-port-0.0.5.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
194daa34c41b54b72b5f630ce660e12f4a22116f7e76dfd4f7da0e42c820c198
|
|
BLAKE2b-256 checksum How to use checksums |
227a72aea74216f79b6177a887c2a006a788b0d1ae43c6674c31a9cd706f37e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
|
Security for get-port 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.