Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sean_pedersen
· 2y ago · 0 comments
I thought import names and PyPI names are not always equal, thus this can not work reliably, right?
Comments
[–]
jonathrg
2y ago
It uses this file which maps import names to package names, but it's only 1152 packages and I'm not sure how it was generated.
https://github.com/bndr/pipreqs/blob/master/pipreqs/mapping
[–]
quietbritishjim
2y ago
In fairness that only seems to list those packages where the import name doesn't match the package name (e.g., it doesn't include numpy) so its overall coverage is a lot larger than that.
[–]
qwerty1793
2y ago
Even worse, there are some different PyPI packages with the same import name. For example, `import snappy` is probably referring to the compression library
https://pypi.org/project/python-snappy/
but it could be this maths package
https://pypi.org/project/snappy/