vendredi 16 septembre 2022

Extending 3rd party library in Python

I would like to extend Python Kubernetes client and add my own methods to some of its classes.

The way I thought it can be done is to create a wrapper library, which would load Kubernetes client and "monkey path it" by adding my own methods to the classes from Kubernetes client. So, that new wrapper library will provide exact same functionality as Kubernetes client + my own custom methods for some of the classes that Kubernetes client provides.

What would be a good way to do that? It would be great to have some examples as well.

Aucun commentaire:

Enregistrer un commentaire