#100DaysOfCode in Python Transcripts
Chapter: Days 61-63: Using the Github API with Python
Lecture: Quick detour: getting help in Python
0:00 Let's look quickly how you can get help in Python. And some time ago we did an article describing the main functions you can use.
0:10 So we have help, dir, combining them, pydoc. So let's see if we can use pydoc on the Github module.
0:18 And to use an outside command in you Jupyter notebook you can use the ! or exclamation mark followed by the command.
0:30 Right, I thought I mistyped a module, but doing it on the package and on the module name, the importer there is no Python documentation found.
0:40 But not to worry, you can just use help on an object. For example, we just created pb, the get_user PyBites
0:48 and I can now type help on pb, and look at that. It's a named user and it shows the class and the methods and even the URL to the Github API.
1:01 So in the next example we want to see the get_repos in action. So I can just go to get_repos, see what it receives, see what it returns.
1:13 And see the endpoint in the API. That's pretty useful. And another command is dir, you can use it like that, and here we see all the
1:29 attributes on that object. So you see the dunder methods, the internal methods and the public interface.
1:37 And now I know I can for example, get followers. How cool is that! Later we will see git gists, and look at how huge the API is, how many methods
1:51 and attributes an object has. You can get a lot of data out of it. We can also just call help on a method like this. So we already saw this one before
2:01 but instead of scrolling through the whole object or class we can just look at a single method. And that's all there is to the basics.
2:11 I use this heavily when I was working with the API and let's look at a practical example next.