henribru / google-api-python-client-stubs

Type stubs for google-api-python-client
https://pypi.org/project/google-api-python-client-stubs/
Apache License 2.0
47 stars 7 forks source link

Docstrings #32

Open henribru opened 1 year ago

henribru commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

mkbabb commented 1 year ago

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.