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
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
Release history Release notifications | RSS feed
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.6.0.tar.gz
(32.2 kB
view hashes)
Built Distribution
gforms-0.6.0-py3-none-any.whl
(36.6 kB
view hashes)