google-api-python-client-stubs icon indicating copy to clipboard operation
google-api-python-client-stubs copied to clipboard

Docstrings

Open henribru opened this issue 2 years ago • 3 comments
trafficstars

The methods that google-api-python-client generates at runtime actually has docstrings. It would be useful to add these in the stubs so that they're shown in your IDE

henribru avatar Dec 22 '22 19:12 henribru

I have a proof of concept for this now. The only issue is that it increases the size of the package from about 20MB to about 160MB ... But it gives a pretty nice DX in VS Code: Before: image After: image image

henribru avatar Dec 22 '22 20:12 henribru

Though that's the size on disk, the download size goes from about 2MB to 18MB since it's compressed.

For comparison the size on disk for google-api-python-client itself is about 74MB, so the stubs would be a bit more than double the size. Might be fine though, at least if it doesn't negatively affects type-checking time

henribru avatar Dec 23 '22 08:12 henribru

I like this, especially if they're already in the docs. Regarding the size issue, maybe a workaround would be to implement something like what boto3's stubs have done - allowing for the grouping of stubs whilst also having the user manually select which API's they want.

mkbabb avatar Jan 05 '23 02:01 mkbabb