Skip to content

Instantly share code, notes, and snippets.

@srathi-monarch
Last active July 8, 2024 06:43
Show Gist options
  • Save srathi-monarch/527a616127a77ae0665b30a47c8fb2a1 to your computer and use it in GitHub Desktop.
Save srathi-monarch/527a616127a77ae0665b30a47c8fb2a1 to your computer and use it in GitHub Desktop.
List python imports
#!/usr/bin/sh
{ grep -Poh '(?<=^import )[^.][A-Za-z_.]*' . -r ; grep -Poh '(?<=^from )[^.].*(?=import)' . -r ; } | cut -d '.' -f 1 | tr -d ' ' | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment