A simple Python library to submit Google Forms in Python.
The goal is to be able to submit Google Forms from anything else than a web page (a Desktop app, or any device that doesn't use a browser).
pip install PyGoogleForm
How to use
First, create your form in Google Form, and then click "view live form". Then in your code:
import PyGoogleForm # Use the url of the page to initialize the GFParser url = "https://docs.google.com/forms/d/1jzDkEha066GwSCcSrCg1yaJJLpJAk0_aIFwf6GQgmmU/viewform" gForm = PyGoogleForm.GFParser(url) # Get the questions by IDs questionIDs = gForm.getQuestionIDs() question1 = gForm.getQuestionInfo(questionIDs) # question1 == [ID, type, question text, [possible choices]] # Answering a question gForm.answerQuestion(question, "ok") # Finally, submit the form gForm.submit()
- can handle only basic types: radio, select, checkbox, text, paragraph text
- doesn't support "required" answers. The form is submitted and the answer recorded in the answer sheet
The project uses a permissive MIT Licence. Do whatever you want with it.
Special thanks to Kristler on Reddit for the inspiration.