Showing posts with label pip. Show all posts
Showing posts with label pip. Show all posts

Get PIP package versions and licenses within a virtual environment

pip install pip-licenses

pip-licenses --format=csv \
--with-urls \
--with-authors \
--with-maintainers \
--with-description > packages.csv

# The following will produce main packages only without nested dependencies.
pip install pipdeptree
pipdeptree -f | grep -P '^\w+' | cut -d = -f 1 > main-packages.txt

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...