cheeseshop

How to find “import name” of any package in Python?

半城伤御伤魂 提交于 2019-12-17 19:33:56
问题 I wonder if is there any reliable and consistant way to get a Python package's "import name" / namespace. For example; Package ; django-haystack Import name ; haystack or Package ; ipython Import name ; IPython So far I know, PyPi doesn't store that information that I've checked with PyPiXmlRpc. I also tried to automate to download the package, extract it and dig the .egg-info but some packages doesn't have that folder at all. Any help will be appreciated and will be used for a good-manner