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

Features

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

Example

import requests
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(requests)
print(form.to_str(indent=2))  # a text representation, may be useful for CLI applications

form.fill(callback)
form.submit(requests)

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.5.1.tar.gz (28.6 kB view hashes)

Uploaded Source

Built Distribution

gforms-0.5.1-py3-none-any.whl (32.4 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