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()
form.load(url)
print(form.to_str(indent=2)) # a text representation, may be useful for CLI applications
form.fill(callback)
form.submit()
# Faster submission for multi-page forms (use less requests)
# (in theory, you may get banned, but now the number of requests isn't checked)
form.submit(emulate_history=True)
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-1.0.1.tar.gz
(27.4 kB
view hashes)
Built Distribution
gforms-1.0.1-py3-none-any.whl
(30.0 kB
view hashes)