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
51 stars 7 forks source link

Consider moving the nested resources #33

Open henribru opened 1 year ago

henribru commented 1 year ago

Currently nested resources are defined as nested classes. This is kinda convenient because it means you only need to import the base resource, e.g. you can do from googleapiclient._apis.analytics.v3.resources import AnalyticsResource and then you can get the nested management resource as AnalyticsResource.ManagementResource. It also mirrors how you get that nested resource in your code, i.e. management_resource = analytics_resource.management(). The main issue with this is that it ends up polluting the autocomplete on the resources. For an example, notice how both management and ManagementResource show up here:

image

The question is if it could it be worth restructuring this in some way to avoid this issue