Python Entry Points Explained

Hey, this was the best python entry points article I’ve ever read. Thank you!

This didn’t work for me:

$ .../snek
Traceback (most recent call last):
  File "...", line 6, in <module>
    from snek import main
ModuleNotFoundError: No module named 'snek'

, until I added py_modules=['snek'], to the setup call, then it worked fine. Thanks!

I read a lot of docs to understand the entry points.
This is the simplest and most creative tutorial I found. Thanks!

Simply amazing. Please don’t deprive the word from amazing posts like this!!

So creative and welllllllll explained

Wow, this tutorials is fantastic!

Great post — thanks so much. For years I’ve only used entry points for console-scripts, but this is super handy, so it feels like a real level-up! :smiley:

One thought: is importlib.metadata.entry_points() the preferred way to do this now, rather than pkg_resources? I was using pkg_resources for a while, following your examples, but then discovered about importlib and saw suggestions that this is the way to go now… If so, might be worth adding a note about this possibility?

This was such a good post, thanks so much.

This is a great tutorial. The piece that I am missing, how does a packager advertise to the world in pypip they offer sneks as a service? Can we just add classifiers willy nilly? Do we use the “Plugins” in conjunction with something else?

I signed up just to say this was the best tutorial ever! Humor greatly appreciated.