New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an easy way to check modules exposed by the package through API #12710
Comments
I think this is likely a duplicate of #5375? |
Partially - proposed solution number 2 is exactly issue #5375. So in a perfect world, I would like to have an API that I can search by import name and get a list of candidate packages. |
I think at the root, the 'hard' part of both of these feature requests is the same: PyPI would need a) some way to introspect the artifacts that are uploaded, b) some way to derive the imports from that c) and to store the results. Given that I think we can merge this into #5375 if you want to add a comment there? |
You can merge. |
Sure! A first step towards this would be prototyping how this would work in https://github.com/pypi/inspector first
It's hard! Introspecting the artifacts requires unpacking/consuming untrusted code in production, we need a safe way to do this. https://github.com/pypi/inspector is a step towards this. I'll close this in favor of #5375. |
Closing this, @di mentioned he was going to, then never did :) |
What's the problem this feature will solve?
There is no programmatic way to find out what modules a package exposes without downloading the package.
This feature is needed for the efficient translation of imports in Python code to the packages they may have come from.
For example
google-api-python-client
exposesapiclient
,googleapiclient
andgoogleapiclient/discovery_cache
. Writing a Python program, you would have:Just looking at the import does not give you any information from which library it was taken, unless it is installed already.
Describe the solution you'd like
There are two ends to this stick:
top_level.txt
file.apiclient
)Additional context
Libraries for automatic generation of requirements.txt from Python source code deal with it in following ways:
top_level.txt
files.The text was updated successfully, but these errors were encountered: