Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 1 | """Retain apiclient as an alias for googleapiclient.""" |
| 2 | |
Craig Citro | 0c18afc | 2014-10-15 21:53:05 -0700 | [diff] [blame] | 3 | import googleapiclient |
Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 4 | |
| 5 | from googleapiclient import channel |
| 6 | from googleapiclient import discovery |
| 7 | from googleapiclient import errors |
| 8 | from googleapiclient import http |
| 9 | from googleapiclient import mimeparse |
| 10 | from googleapiclient import model |
Bu Sun Kim | 66bb32c | 2019-10-30 10:11:58 -0700 | [diff] [blame] | 11 | |
Eric Wolak | 980c308 | 2018-06-04 11:27:23 -0700 | [diff] [blame] | 12 | try: |
| 13 | from googleapiclient import sample_tools |
| 14 | except ImportError: |
| 15 | # Silently ignore, because the vast majority of consumers won't use it and |
| 16 | # it has deep dependence on oauth2client, an optional dependency. |
| 17 | sample_tools = None |
Craig Citro | 7547de6 | 2014-10-13 09:21:08 -0700 | [diff] [blame] | 18 | from googleapiclient import schema |
Craig Citro | 076b333 | 2014-10-15 12:16:42 -0700 | [diff] [blame] | 19 | |
Craig Citro | b939a7d | 2014-10-17 20:27:26 -0700 | [diff] [blame] | 20 | _SUBMODULES = { |
Bu Sun Kim | 66bb32c | 2019-10-30 10:11:58 -0700 | [diff] [blame] | 21 | "channel": channel, |
| 22 | "discovery": discovery, |
| 23 | "errors": errors, |
| 24 | "http": http, |
| 25 | "mimeparse": mimeparse, |
| 26 | "model": model, |
| 27 | "sample_tools": sample_tools, |
| 28 | "schema": schema, |
Craig Citro | b939a7d | 2014-10-17 20:27:26 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | import sys |
Bu Sun Kim | 66bb32c | 2019-10-30 10:11:58 -0700 | [diff] [blame] | 32 | |
Anthonios Partheniou | 9f7b410 | 2021-07-23 12:18:25 -0400 | [diff] [blame] | 33 | for module_name, module in _SUBMODULES.items(): |
Bu Sun Kim | 66bb32c | 2019-10-30 10:11:58 -0700 | [diff] [blame] | 34 | sys.modules["apiclient.%s" % module_name] = module |