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

Uploaded Source

File details

Details for the file PyGoogleForm-0.5.tar.gz.

File metadata

  • Download URL: PyGoogleForm-0.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyGoogleForm-0.5.tar.gz
Algorithm Hash digest
SHA256 67a67b55ee27a0a050f8b1d9039b3c5c981e8c85345a5a5b2ce41822b74c803f
MD5 99c49d8b4727ebe86675cc4940edf075
BLAKE2b-256 e979ce9b17ca9f0c7188309c2e610ce033454fda283232a7aca38ef7208aecdf

See more details on using hashes here.

Supported by

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