Skip to content
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Compat check PyPI](https://python-compatibility-tools.appspot.com/one_badge_image?package=google-api-python-client)](https://python-compatibility-tools.appspot.com/one_badge_target?package=google-api-python-client)
[![Compat check github](https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-api-python-client.git)](https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-api-python-client.git)

This is the Python client library for Google's discovery based APIs. To get started, please see the [full documentation for this library](https://developers.google.com/api-client-library/python/). Additionally, [dynamically generated documentation](http://google.github.io/google-api-python-client/docs/epy/index.html) is available for all of the APIs supported by this library.
This is the Python client library for Google's discovery based APIs. To get started, please see the [docs folder](docs/README.md).

These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

Expand Down
20 changes: 20 additions & 0 deletions describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

__author__ = 'jcgregorio@google.com (Joe Gregorio)'

from collections import OrderedDict
import argparse
import collections
import json
import os
import re
Expand Down Expand Up @@ -394,6 +396,7 @@ def document_api_from_discovery_document(uri):
if FLAGS.discovery_uri:
document_api_from_discovery_document(FLAGS.discovery_uri)
else:
api_directory = collections.defaultdict(list)
http = build_http()
resp, content = http.request(
FLAGS.directory_uri,
Expand All @@ -402,5 +405,22 @@ def document_api_from_discovery_document(uri):
directory = json.loads(content)['items']
for api in directory:
document_api(api['name'], api['version'])
api_directory[api['name']].append(api['version'])

# sort by api name and version number
for api in api_directory:
api_directory[api] = sorted(api_directory[api])
api_directory = OrderedDict(sorted(api_directory.items(), key = lambda x: x[0]))

markdown = []
for api, versions in api_directory.items():
markdown.append('## %s' % api)
for version in versions:
markdown.append('* [%s](http://googleapis.github.io/google-api-python-client/docs/dyn/%s_%s.html)' % (version, api, version))
markdown.append('\n')

with open('docs/dyn/index.md', 'w') as f:
f.write('\n'.join(markdown).encode('utf-8'))

else:
sys.exit("Failed to load the discovery document.")
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ access to many Google APIs.

Learn how to use the Google API Python Client with these guides:

### Usage Guides

- [Getting Started](start.md)
- [Auth](auth.md)
- [API Keys](api-keys.md)
Expand All @@ -32,4 +34,8 @@ Learn how to use the Google API Python Client with these guides:
- [Understand Thread Safety](thread_safety.md)
- [Use Google App Engine](google_app_engine.md)
- [Use Django](django.md)


### Reference Documentation

- Reference documentation for the the core library [googleapiclient](http://googleapis.github.io/google-api-python-client/docs/epy/index.html).
- [Library reference documentation by API](dyn/index.md).
Loading