Package: search-google
InstallInstallPythonInstallsearch_googleviapippip install search_googleFor the latest developer version, seeDeveloper Install.UsageFor help in the console:search_google -hEnsure that aCSE IDand aGoogle API developer keyare set:search_google -s cx="your_cse_id"
search_google -s build_developerKey="your_dev_key"Search the web for keyword “cat”:search_google "cat"
search_google "cat" --save_links=cat.txt
search_google "cat" --save_downloads=downloadsSearch for “cat” images:search_google cat --searchType=image
search_google "cat" --searchType=image --save_links=cat_images.txt
search_google "cat" --searchType=image --save_downloads=downloadsUse as a Python module:# Import the api module for the results classimportsearch_google.api# Define buildargs for cse apibuildargs={'serviceName':'customsearch','version':'v1','developerKey':'your_api_key'}# Define cseargs for searchcseargs={'q':'keyword query','cx':'your_cse_id','num':3}# Create a results objectresults=search_google.api.results(buildargs,cseargs)# Download the search results to a directoryresults.download_links('downloads')For more usage details, see theDocumentation.ContributionsReport ContributionsReports for issues and suggestions can be made using theissue submissioninterface.When possible, ensure that your submission is:Descriptive: has informative title, explanations, and screenshotsSpecific: has details of environment (such as operating system and hardware) and software usedReproducible: has steps, code, and examples to reproduce the issueCode ContributionsCode contributions are submitted viapull requests:Ensure that you pass theTestsCreate a newpull requestProvide an explanation of the changesA template of the code contribution explanation is provided below:## Purpose

The purpose can mention goals that include fixes to bugs, addition of features, and other improvements, etc.

## Description

The description is a short summary of the changes made such as improved speeds, implementation

## Changes

The changes are a list of general edits made to the files and their respective components.
* `file_path1`:
    * `function_module_etc`: changed loop to map
    * `function_module_etc`: changed variable value
* `file_path2`:
    * `function_module_etc`: changed loop to map
    * `function_module_etc`: changed variable value

## Notes

The notes provide any additional text that do not fit into the above sections.For more information, seeDeveloper InstallandImplementation.Developer NotesDeveloper InstallInstall the latest developer version withpipfrom github:pip install git+https://github.com/rrwen/search_googleInstall fromgitcloned source:Ensuregitis installedClone into current pathInstall viapipgit clone https://github.com/rrwen/search_google
cd search_google
pip install . -ITestsClone into current pathgit clonehttps://github.com/rrwen/search_googleEnter into foldercd search_googleEnsureunittestis availableSet yourCSE IDandGoogle API developer keyRun testsReset config file to defaultsPlease note that this will use up 7 requests from your quotapip install . -I
python -m search_google -s cx="your_cse_id"
python -m search_google -s build_developerKey="your_dev_key"
python -m unittest
python -m search_google -dDocumentation MaintenanceEnsuresphinxis installedpip install-UsphinxUpdate the documentation indocs/pip install . -I
sphinx-build -b html docs/source docsUpload to githubEnsuregitis installedAdd all files and commit changesPush to githubgit add .
git commit -a -m "Generic update"
git pushUpload to PyPiEnsuretwineis installedpip install twineEnsuresphinxis installedpip install-UsphinxRun tests and check for OK statusDeletedistdirectoryUpdate the versionsearch_google/__init__.pyUpdate the documentation indocs/Create source distributionUpload toPyPipip install . -I
python -m search_google -s cx="your_cse_id"
python -m search_google -s build_developerKey="your_dev_key"
python -m unittest
python -m search_google -d
sphinx-build -b html docs/source docs
python setup.py sdist
twine upload dist/*ImplementationThis command line tool uses theGoogle Custom Search Engine (CSE)to perform web and image searches. It relies ongoogleapiclient.buildandcse.list, wherebuildwas used to create a Google API object andcsewas used to perform the searches.The classsearch_google.apisimply passed a dictionary of arguments intobuildandcseto process the returned results with properties and methods.search_google.cliwas then used to create a command line interface forsearch_google.api.In order to usebuildandcse, aGoogle Developer API Keyand aGoogle CSE IDneeds to be created for API access (seesearch_google Setup). Creating these keys also required aGmailaccount for login access.googleapiclient.build  <-- Google API
          |
       cse.list        <-- Google CSE
          |
   search_google.api   <-- search results
          |
   search_google.cli   <-- command lineA rough example is provided below thanks to thecustomsearch examplefrom Google:fromapiclient.discoveryimportbuild# Set developer key and CSE IDdev_key='a_developer_key'cse_id='a_cse_id'# Obtain search results from Google CSEservice=build("customsearch","v1",developerKey=dev_key)results=service.cse().list(q='cat',cx=cse_id).execute()# Manipulate search results after ...