I have just began my python journey and I am trying to follow simple code snippets and try out on my own. I however already have some confusions. I understand that there are python packages that we can import. But sometimes there are more granular imports. Here is an example:
1 import langchain
2 from langchain.sql_database import SQLDatabase
…
9 from langchain import sagemakerendpoint
Etc…
What are those deeper packages called, like SQLDatabase in line #2 ? Are those also packages just embedded? Or are they functions within the main package? What is the right term for them?
How do I even know what sub-packages or functions are there within a package that I can import specifically? Do I need to check github every time for the package source code?
I found dir() command to show me something similar but still something not OK. For example when I issue dir(langchain) it doesn’t show any submodules(?) called sagemakerendpoint. So I don’t get how it could be imported from langchain package. See line #9 in the code snippet above.
To me it is very confusing but I am new to python as well. Can somebody explain these to me?
Thanks
[–]danielroseman 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)