So for starters in Ubuntu 18.04 it works this way:

  1. Install package python-nautilus
  2. Get Test Extension from here and save as TestExtension.py
  3. Copy TestExtension.py to /usr/share/nautilus-python/extensions (with sudo)
  4. Change to that directory and adapt permissions: sudo chmod u+x TestExtension.py
  5. Restart Nautilus: killall nautilus
  6. Klick with the right mouse button on some file and you will see Showing <Filename> in the context menu.

  7. Adapt this imdb script to your environment.