Skip to main content

Kubernetes Port-Forward Go-Edition For Python

Project description

portforward

https://img.shields.io/pypi/v/portforward.svg https://img.shields.io/pypi/status/portforward.svg Documentation Status

Kubernetes Port-Forward Go-Edition For Python

Quickstart

import requests

import portforward


def main():
    namespace = "test"
    pod_name = "web"
    local_port = 9000  # from port
    pod_port = 80  # to port

    # No path to kube config provided - will use default from $HOME/.kube/config
    with portforward.forward(namespace, pod_name, local_port, pod_port):
        response = requests.get("http://localhost:9000")
        print(f"Done: \n'{response.status_code}'\n'{response.text[:20]}...'")


if __name__ == "__main__":
    main()

Features

  • Go native Kubernetes port-forwarding with the .kube/config from the home dir or any other path to config.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

This project is enabled by setuptools-golang.

History

0.2.0 (2021-08-14)

  • First Release on PyPI.

  • Made path to kube config variable.

  • Port-forwarding became non-blocking.

  • Fixed verification bug when port was None.

  • Added throwing own error.

0.1.0 (2021-08-09)

  • First release on Test PyPI.

  • Blocking port-forward with fixed path for kube config.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portforward-0.2.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

portforward-0.2.0-cp39-cp39-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.9Windows x86-64

portforward-0.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

portforward-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

portforward-0.2.0-cp38-cp38-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.8Windows x86-64

portforward-0.2.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

portforward-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

portforward-0.2.0-cp37-cp37m-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.7mWindows x86-64

portforward-0.2.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

portforward-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

portforward-0.2.0-cp36-cp36m-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.6mWindows x86-64

portforward-0.2.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

portforward-0.2.0-cp36-cp36m-macosx_10_14_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

Details for the file portforward-0.2.0.tar.gz.

File metadata

  • Download URL: portforward-0.2.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.4

File hashes

Hashes for portforward-0.2.0.tar.gz
Algorithm Hash digest
SHA256 920d4cd6e26c58a6cea2a6acf9ff35463165722c1b94429f7336b2547f0ad4ef
MD5 347224666a7130982c85474258363d72
BLAKE2b-256 3b12c34f0f87032a152f8eb4b2463995f12a1af28259b6d994e26ee745649da1

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f9282335d4e5a2894cbf30b7d13ed690aa5c7bfa3ee76a3e0a3e6b241dd74b15
MD5 619d6e19c3f9f6898e7556827b4ee7eb
BLAKE2b-256 2fded77e8c4104d8c7936ba35af8af6d3da13a1155e38fb710283b487639cda5

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for portforward-0.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9d0355ccd38f0e9711b7c3da4452ce4c0b26c94846d4fa80ab337d8b3605493c
MD5 d6ec816e03c8ffd18624d71bc268f676
BLAKE2b-256 25639907663014aaa020425435c630cf279fe122f0e70e5aec1220fa9a08cc37

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 17.5 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4c851cfbf3b10f583c9dc82882326f54f4c40fbe6da95ddc91ecf9f7ec64c3cc
MD5 8b184b1e84efab3192b3d99e79070c11
BLAKE2b-256 bc829f81bdb5777f423bd18b7c76d06f240f87206d2768f45cd20b050154b1bb

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c6ee1adb958761e10a504d5e5a636dd1e5bb3dfc81277f90eed84a3e8f9d15c7
MD5 2de1a65f4ea9f54fa8f9dd8597993803
BLAKE2b-256 98bc6e613dd9dd71e2727f47e54410d2c7137aa5a9450c46ba98d34220202563

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for portforward-0.2.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 70bf10ed973a565f93d9484635671ac42ecae38640ab4440bb2d5de93c537da4
MD5 aeaa43ad225d989c0c29356631d072e4
BLAKE2b-256 b92494b9c2da1fc4a258b15e1dc5973ccccc0d5e1e942d1202af9fbfc381a791

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 17.5 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 909bc674f672bd3e690652524680b74c4b52afc5d3aa508172a3aeda6b7e9b90
MD5 20d4b57d911acddfbf7b2dab64325da7
BLAKE2b-256 da5dd485e7ad59aff36f84253d0cdaf0bcaca88b00b4a0141e11e5e6d163fe68

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 addb4f540058145886aa03f89a7633acfd973d0e190ef448980d1d68793ad8b3
MD5 37c192bf35620972ec1d6c92b793c83f
BLAKE2b-256 8428f75aa779ba13babc7fd4cf9e87d38def35e7668cb045bca6746ed92be94e

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for portforward-0.2.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 966bc2e7b787dc93f65af990ab8235cf9ed35d3cde7a21b10dfb67a16ec86311
MD5 e2e7a1b149d7adf465ef151b9839ceb0
BLAKE2b-256 3add8f37b8915bc8bac0bf12f8eb3d348f0835f88acd652821fdfd34d2605259

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 17.5 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 851a4de459963ff197d29bd036f6701d6a605f1a5b5f5fcdd8c965ec8a181661
MD5 d258157c325651f41f5c7024c196f897
BLAKE2b-256 c0c7f55434a534691a7fe91c8aec899903cac35a4987ba332b79bf8f2ce8877d

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 72ed2915000b6288a1d1d5f2a11c6d5d9906996cf434cd3c8ccc9852632aabd0
MD5 d57e4aa26f4b190d000fd044c2a34f7e
BLAKE2b-256 02cb115f1111f22a0c57a145966e7952e3cf3b9997851daee79192648918ede3

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for portforward-0.2.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e53b08730c11eef75321164aad7d3b3d9e6a8d985810df66768f2052e7fe357b
MD5 1d6275b4f010efea54590d9195fe7964
BLAKE2b-256 b41689cb9ab6c63b5a43244006e190912f468ae48f3ae84d9417acd86c902802

See more details on using hashes here.

File details

Details for the file portforward-0.2.0-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: portforward-0.2.0-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 17.5 MB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for portforward-0.2.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5f295f47e0d52501e88b4460f2813258274fc2b9cee90fa6dd0bb016dfa53362
MD5 ef13f977cb9e51cb5413adfb4e35b963
BLAKE2b-256 ed69e7b2d1dac882bd081322e55872721d3ce9678173b88a574e47eecc7cccc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page