GForms
A python wrapper for public Google Forms.
This package does not implement form editing / sharing / other actions with user-owned forms
Installation
python3 -m pip install gforms
Features
- Form parsing
- All form settings are parsed
- Multi-page forms are supported
- Elements with input validation are supported
- Form filling
- Fill the entire form using a single callback function (see example)
- Fill individual elements
- Validate the form before submission
- Form submission
- Faster submission for multi-page forms (history emulation)
Limitations
- Forms with required sign-in cannot be submitted
- Forms with file upload cannot be parsed (sign-in is required for loading the form)
- A CAPTCHA needs to be solved in order to send an e-mail with a response copy (when this option is enabled). CAPTCHA handling should be implemented separately
- Form style is not parsed
Example
See example.py for more details.
from gforms import Form
from gforms.elements import Short, Value
def callback(element, page_index, element_index):
# fill an element based on its position
if page_index == 0 and element_index == 1:
return 'Yes'
# fill an element based on its type and name
if isinstance(element, Short) and element.name == 'Your opinion:':
return input(element.name)
# fill choice elements with random values, skip optional elements if fill_optional is not used
return Value.DEFAULT
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 only one POST request)
# (in theory, you may get banned, but now the actual number of requests isn't checked)
form.submit(emulate_history=True)
Metadata
Release files for gforms 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gforms-1.3.2.tar.gz | 33.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gforms-1.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.3 kB
Release files / gforms-1.3.2.tar.gz
| Download URL | gforms-1.3.2.tar.gz |
|---|---|
| Size | 33.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2299fc32bb01a3dfd70f1ab0d20d867b7b83303c32b1835e2204e8e5c6142c08
|
|
BLAKE2b-256 checksum How to use checksums |
423a7bc31417e927cf88680c583e394ed9fa6ceacb474008117182c32475becc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / gforms-1.3.2-py3-none-any.whl
| Download URL | gforms-1.3.2-py3-none-any.whl |
|---|---|
| Size | 35.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bacd811afcc6cff019cf454eb0af8f8dccde5af526590122143ea559d1e6ff4d
|
|
BLAKE2b-256 checksum How to use checksums |
6aec558ac17745e4276fc26fe4d64998316af37f7f0a3f1a79b83e94a13f20d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for gforms 1.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.