This may sound weird to you, but why don't we use a single dict that can have different types of keys, either strings when searching for provider name, or classes when searching for provider type. This is Python after all so we are not subject to single-type keys.

I see no danger in overloading the providers dictionary this way, and the code reads clearer.