I’m very +1 on this (mostly on the “reverse-lookup” part).
For Pantsbuild, we have to map import names to code (either third party packages or first party code).
Our approach is to first look up the name in a map of “known” packages that map to modules that don’t match their package names, with a fallback of the package name is module name. Users can add their own mapping to help us fill in the blanks.
So a server we could ping and cache the result would be immensely helpful.
In another world, it’d be useful to map imports to packages as per the discussion in PEP 722 (specifically the thought experiment of if we already had this kind of mapping).