Skip to main content

Google Forms wrapper for Python

Project description

GForms

A python wrapper for public Google Forms.

This package does not implement form editing / sharing / other actions with user-owned forms

Forms with required sign-in are not supported

Installation

python3 -m pip install gforms

Features

  • Parse a form
  • Fill a form
  • Submit a form

Example

See example.py for more details.

from gforms import Form
from gforms.elements import Short

def callback(element, page_index, element_index):
    if page_index == 0 and element_index == 1:  # fill an element based on its position
        return 'Yes'
    if isinstance(element, Short) and element.name == 'Your opinion:':
        return input(element.name)

url = 'https://docs.google.com/forms/d/e/.../viewform'
form = Form(url)

form.load()
print(form.to_str(indent=2))  # a text representation, may be useful for CLI applications

form.fill(callback)
form.submit()

# Faster but less stable submission for multi-page forms
form.submit(emulate_history=True)

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

gforms-0.10.0.tar.gz (22.6 kB view hashes)

Uploaded Source

Built Distribution

gforms-0.10.0-py3-none-any.whl (25.3 kB view hashes)

Uploaded Python 3

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