Pycon Israel 2021

"Clippy" for Python - Let's build a real-time code companion by hooking over any function.
05-03, 16:00–16:45 (Asia/Jerusalem), PyData Track 1

Python can do so much, including using python to change python behavior. In this talk, we will see how we can hook over any function in order to create an online “helper” in the style of Clippy for the old Office software. This can be useful for refe


This talk stems from the package I've built dovpanda. dovpanda is an overlay companion for working with pandas in an analysis environment - it hooks over any pandas method and suggests better ways code. We use sys.modules to replace the original function with a modified version while keeping track of the originals using contextmanagers. We then use inspect to understand what parameters were sent by the user so we can employ them to the companion's benefit. Using ast the companion can also understand information about runtime such as checking whether the function call was used in an assignment or part of a complex statement.
Python is so wonderful, as it lets you control Python itself. This really feels like superpowers. In this talk I hope to scratch the surface of a few examples for such superpowers.


Session language

English

Target audience

Developers, DevOps, Data Scientists, R&D

I am a data scientist at SentinelOne, a rapidly-growing cybersecurity AI company. I am interested in data science, machine learning, deep learning, Python scientific programming, data visualizations, and Bayesian modeling. Specifically, I am a pandas enthusiast, and maintain dovpanda - a pandas companion package that helps data scientists with writing better, more concise pandas code.

Check out dovpanda
Check out my other talks