Skip to main content

A simple Python library to submit Google Forms in Python.

Project description

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).

Installation

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[0])
# question1 == [ID, type, question text, [possible choices]]

# Answering a question
gForm.answerQuestion(question[0], "ok")

# Finally, submit the form
gForm.submit()

Limitations

  • 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

Licence

The project uses a permissive MIT Licence. Do whatever you want with it.

Resource

Special thanks to Kristler on Reddit for the inspiration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyGoogleForm-0.5.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page