How can I check for an entry point using pkg_resources?
===

<!-- language: python -->

I'm using `pkg_resources` to load plugins/modules for a program that uses multiple chat protocols. So far, I've been able to get a list of modules associated with a name using `pkg_resources.iter_entry_points('app.protocols')`, but I can't work out how to get specific modules (so that only the protocols that will be used are loaded).

So far, I've worked around this by loading the list into a dictionary of available protocols, and then loading the each required module from the entry point.

    availible_protocols = dict()
    for entry_point in pkg_resources.iter_entry_points(group='app.protocols'):
        availible_protocols[entry_point.name] = entry_point 
    
    for protocol_name in required_protocols:
        availible_protocols[protocol_name].load()

Is there a better way of doing this, preferably so I can load protocols/modules directly?