Home | Trees | Index | Help |
|
---|
Module google |
|
Python wrapper for Google web APIs
This module allows you to access Google's web APIs through SOAP, to do things like search Google and get the results programmatically. Described here
You need a Google-provided license key to use these services. Follow the link above to get one. These functions will look in several places (in this order) for the license key:>>> import google >>> google.setLicense('...') # must get your own key! >>> data = google.doGoogleSearch('python') >>> data.meta.searchTime 0.043221000000000002 >>> data.results[0].URL 'http://www.python.org/' >>> data.results[0].title '<b>Python</b> Language Website'
Version: 0.6
License: Python
Contributors:
Classes | |
---|---|
SearchResult |
Encapsulates the results from a search. |
SearchResultsMetaData |
Container class for metadata about a given search query's results. |
SearchReturnValue |
complete search results for a single query |
_OutputFormatter |
|
_SearchBase |
|
_TextOutputFormatter |
Exceptions | |
---|---|
NoLicenseKey |
Thrown when the API is unable to find a valid license key. |
Function Summary | |
---|---|
String |
Retrieve a page from the Google cache. |
SearchReturnValue
|
Search Google using the SOAP API and return the results. |
Get spelling suggestions from Google | |
String |
Get the Google APIs license key |
String |
Get the HTTP proxy we use for accessing Google |
Command-line interface. | |
Set the Google APIs license key | |
Set the HTTP proxy to be used when accessing Google | |
_contentsOf(dirname,
filename)
| |
_getRemoteServer(http_proxy)
| |
_getScriptDir()
| |
_makeFormatter(outputFormat)
| |
_marshalBoolean(value)
| |
_output(results,
params)
| |
Run functional test suite. | |
Display usage information for the command-line interface | |
Display a formatted version string for the module |
Variable Summary | |
---|---|
str |
__author__ = 'Mark Pilgrim (f8dy@diveintomark.org)'
|
str |
__copyright__ = 'Copyright (c) 2002 Mark Pilgrim'
|
str |
__credits__ = 'David Ascher, for the install script\nEri...
|
str |
__cvsversion__ = '1.5'
|
str |
__date__ = '2004/02/25 23:46:07'
|
str |
__license__ = 'Python'
|
str |
__version__ = '0.6'
|
dict |
__warningregistry__ = {('SOAPpy not imported. Trying leg...
|
NoneType |
HTTP_PROXY = None |
NoneType |
LICENSE_KEY = None |
booleanType |
_false = <SOAP.booleanType at 136010332>
|
str |
_googlefile1 = '.googlekey'
|
str |
_googlefile2 = 'googlekey.txt'
|
tuple |
_licenseLocations = ((<function <lambda> at 0x81ad53c>, ...
|
str |
_namespace = 'urn:GoogleSearch'
|
booleanType |
_true = <SOAP.booleanType at 136067500>
|
str |
_url = 'http://api.google.com/search/beta2'
|
Function Details |
---|
doGetCachedPage(url, license_key=None, http_proxy=None)Retrieve a page from the Google cache. You need a license key to call this function; see the Google APIs site to get one. Then you can either pass it to this function every time, or set it globally; see thegoogle module-level docs for details.
|
doGoogleSearch(q, start=0, maxResults=10, filter=1, restrict='', safeSearch=0, language='', inputencoding='', outputencoding='', license_key=None, http_proxy=None)Search Google using the SOAP API and return the results. You need a license key to call this function; see the Google APIs site to get one.
Then you can either pass it to this function every time, or set it
globally; see the See http://www.google.com/help/features.html for examples of advanced features. Anything that works at the Google web site will work as a query string in this method. You can use the See the API reference for more advanced examples and a full list of
country codes and topics for use in the
|
doSpellingSuggestion(phrase, license_key=None, http_proxy=None)Get spelling suggestions from Google You need a license key to call this function; see the Google APIs site to get one. Then you can either pass it to this function every time, or set it globally; see thegoogle module-level docs for details.
|
getLicense(license_key=None)Get the Google APIs license key The key can be read from any number of locations. See the module-leve documentation for the search order.
|
getProxy(http_proxy=None)Get the HTTP proxy we use for accessing Google
|
main(argv)Command-line interface. |
setLicense(license_key)Set the Google APIs license key
|
setProxy(http_proxy)Set the HTTP proxy to be used when accessing Google
|
_test()Run functional test suite. |
_usage()Display usage information for the command-line interface |
_version()Display a formatted version string for the module |
Variable Details |
---|
__author__
|
__copyright__
|
__credits__
|
__cvsversion__
|
__date__
|
__license__
|
__version__
|
__warningregistry__
|
HTTP_PROXY
|
LICENSE_KEY
|
_false
|
_googlefile1
|
_googlefile2
|
_namespace
|
_true
|
_url
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Fri Mar 18 11:10:13 2005 | http://epydoc.sf.net |