Iqbal´s DLQ main Help

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

conda env list

create a new one with pip and Python 3.10 for example

conda create -n demo python=3.10 pip

activate env

switch env simply with

conda activate demo

install deps

congrats, you have an isolated env tailored to your py script needs:

install deps with

pip install -r requirements.txt

profit

run script with

python rm-empty-targets.py
Last modified: 12 March 2024