Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sean_pedersen
on Sept 30, 2024
|
parent
|
context
|
favorite
| on:
Generate pip requirements.txt file based on import...
I thought import names and PyPI names are not always equal, thus this can not work reliably, right?
jonathrg
on Sept 30, 2024
|
next
[–]
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
on Sept 30, 2024
|
parent
|
next
[–]
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
on Sept 30, 2024
|
prev
|
next
[–]
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/
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: