Metadata-Version: 2.1
Name: portforward
Version: 0.2.8
Summary: Kubernetes Port-Forward Go-Edition For Python 
Home-page: https://github.com/pytogo/portforward
Author: Sebastian Ziemann
Author-email: corka149@mailbox.org
License: MIT license
Keywords: portforward
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.6
License-File: LICENSE
License-File: AUTHORS.rst

===========
portforward
===========


.. image:: https://img.shields.io/pypi/v/portforward.svg
        :target: https://pypi.python.org/pypi/portforward

.. image:: https://img.shields.io/pypi/status/portforward.svg
        :target: https://pypi.python.org/pypi/portforward

.. image:: https://readthedocs.org/projects/portforward/badge/?version=latest
        :target: https://portforward.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status

.. image:: https://github.com/pytogo/portforward/actions/workflows/python-app.yml/badge.svg
        :target: https://github.com/pytogo/portforward/actions
        :alt: Build status



Kubernetes Port-Forward Go-Edition For Python


* Free software: MIT license
* Documentation: https://portforward.readthedocs.io.


Installation
-----------------------------

Wheels are available for:

* Windows
* MacOS X
* Linux

with Python versions:

* 3.6
* 3.7
* 3.8
* 3.9
* 3.10

and architectures:

* x84_64

**Requirements for installation from source**

The following things are required when there is no wheel available for the target system.

* `Go` installed and available in the path (at least v1.16 / https://go.dev)
* `Python` (at least v3.6 - below was never tested but might work)
* `gcc` (for Windows available via MinGW)

Pip knows how to install ``portforward``.

.. code-block::

    pip install portforward


Quickstart
----------

.. code-block:: Python

    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.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

This project is enabled by setuptools-golang_.

.. _setuptools-golang: https://github.com/asottile/setuptools-golang


=======
History
=======


0.2.8 (2022-08-22)
------------------
* Added verbose mode


0.2.7 (2021-10-05)
------------------
* Added missing import
* Added type hint


0.2.6 (2021-10-05)
------------------
* Fixed type hint


0.2.5 (2021-09-09)
------------------
* Moved the actual portforward to own module


0.2.4 (2021-08-23)
------------------
* Added adal import for Azure AD
* Fixed host IPs with paths
* Made timeout flexible


0.2.3 (2021-08-23)
------------------
* Fixed case when hostIP contains a path
* Added common and cloud provider auth plugins


0.2.2 (2021-08-23)
------------------
* Fixed missing module ``portforward``


0.2.1 (2021-08-19)
------------------
* Decrease binary size if pre-compile wheels
  (Improvement of setuptools-golang)


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.


