Python scripting ( cheatsheet )
Occasionally, you might need to resort to some scripting for bulk changes, due to various reasons
For instance, recent encounters for me was bulk deletion of targets in Snyk.
Snyk UI provides a good way to bulk delete projects, but not their targets
I came across this awesome snyk-cx-tools that did exactly that
Other use cases, are side quests your team might come across like grabbing specific data from Datadog APIs, etc.
I would like to just keep track of a process that helps keep python
So, one of the challenges you´ll come across in Python is to have some proper isolation
I like what Conda does with virtual environments, it is one step ahead of out of the box venv provides
How to
conda / venv for clean envs
create a conda env w/ pip
you can list envs with
create a new one with pip and Python 3.10 for example
activate env
switch env simply with
install deps
congrats, you have an isolated env tailored to your py script needs:
install deps with
profit
run script with