gformbot 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gformbot-0.1.0/LICENSE ADDED
@@ -0,0 +1,180 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other transformations
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any patent
81
+ claim embodied in the Work constitutes patent patent or contributory
82
+ patent infringement, then any patent licenses granted to You under
83
+ this License for that Work shall terminate as of the date such
84
+ litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text file
107
+ distributed as part of the Derivative Works; within the Source
108
+ form or documentation, if provided along with the Derivative
109
+ Works; or, within a display generated by the Derivative Works,
110
+ if and wherever such third-party notices normally appear. The
111
+ contents of the NOTICE file are for informational purposes only
112
+ and do not modify the License. You may add Your own attribution
113
+ notices within Derivative Works that You distribute, alongside
114
+ or as an addendum to the NOTICE text from the Work, provided
115
+ that such additional attribution notices cannot be construed
116
+ as modifying the License.
117
+
118
+ You may add Your own license statement for Your modifications and
119
+ may provide additional grant of rights to use, copy, modify, merge,
120
+ publish, distribute, sublicense, and/or sell copies of the Work,
121
+ subject to the terms and conditions of the License.
122
+
123
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
124
+ any Contribution intentionally submitted for inclusion in the Work
125
+ by You to the Licensor shall be under the terms and conditions of
126
+ this License, without any additional terms or conditions.
127
+ Notwithstanding the above, nothing herein shall supersede or modify
128
+ the terms of any separate license agreement you may have executed
129
+ with Licensor regarding such Contributions.
130
+
131
+ 6. Trademarks. This License does not grant permission to use the trade
132
+ names, trademarks, service marks, or product names of the Licensor,
133
+ except as required for reasonable and customary use in describing the
134
+ origin of the Work and reproducing the content of the NOTICE file.
135
+
136
+ 7. Disclaimer of Warranty. Unless required by applicable law or
137
+ agreed to in writing, Licensor provides the Work (and each
138
+ Contributor provides its Contributions) on an "AS IS" BASIS,
139
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
140
+ implied, including, without limitation, any warranties or conditions
141
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
142
+ PARTICULAR PURPOSE. You are solely responsible for determining the
143
+ appropriateness of using or reproducing the Work and assume any
144
+ risks associated with Your exercise of permissions under this License.
145
+
146
+ 8. Limitation of Liability. In no event and under no legal theory,
147
+ whether in tort (including negligence), contract, or otherwise,
148
+ unless required by applicable law (such as deliberate and grossly
149
+ negligent acts) or agreed to in writing, shall any Contributor be
150
+ liable to You for damages, including any direct, indirect, special,
151
+ incidental, or exemplary damages of any character arising as a result
152
+ of this License or out of the use or inability to use the Work
153
+ (including but not limited to damages for loss of goodwill, work
154
+ stoppage, computer failure or malfunction, or all other commercial
155
+ damages or losses), even if such Contributor has been advised of the
156
+ possibility of such damages.
157
+
158
+ 9. Accepting Warranty or Additional Liability. While redistributing
159
+ the Work or Derivative Works thereof, You may choose to offer, and
160
+ charge a fee for, acceptance of support, warranty, indemnity, or
161
+ other liability obligations and/or rights consistent with this
162
+ License. However, in accepting such obligations, You may offer only
163
+ conditions consistent with this License, and may charge a fee for
164
+ acceptance of warranty or additional liability.
165
+
166
+ END OF TERMS AND CONDITIONS
167
+
168
+ Copyright 2024 yogeshkrishna
169
+
170
+ Licensed under the Apache License, Version 2.0 (the "License");
171
+ you may not use this file except in compliance with the License.
172
+ You may obtain a copy of the License at
173
+
174
+ http://www.apache.org/licenses/LICENSE-2.0
175
+
176
+ Unless required by applicable law or agreed to in writing, software
177
+ distributed under the License is distributed on an "AS IS" BASIS,
178
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
+ See the License for the specific language governing permissions and
180
+ limitations under the License.
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: gformbot
3
+ Version: 0.1.0
4
+ Summary: A general-purpose Google Form auto-filler CLI — inspect any form, supply a response pool, and submit at scale.
5
+ Author: yogeshkrishna
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/yogeshkrishna/google_form_test_bot
8
+ Project-URL: Repository, https://github.com/yogeshkrishna/google_form_test_bot
9
+ Project-URL: Bug Tracker, https://github.com/yogeshkrishna/google_form_test_bot/issues
10
+ Keywords: google-forms,automation,selenium,cli,bot
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: selenium<5,>=4.25
25
+ Requires-Dist: click>=8.1
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: rich>=13.0
28
+ Requires-Dist: InquirerPy>=0.3.4
29
+ Provides-Extra: clipboard
30
+ Requires-Dist: pyperclip; extra == "clipboard"
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest; extra == "dev"
33
+ Requires-Dist: build; extra == "dev"
34
+ Requires-Dist: twine; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # gformbot
38
+
39
+ > **A general-purpose Google Form auto-filler CLI.**
40
+ > Inspect any form, supply a response pool (or let it generate synthetic answers), and submit at scale.
41
+
42
+ ---
43
+
44
+ ## Install
45
+
46
+ ```bash
47
+ pip install gformbot
48
+ ```
49
+
50
+ For clipboard URL detection (handy — just copy the form URL before running):
51
+
52
+ ```bash
53
+ pip install "gformbot[clipboard]"
54
+ ```
55
+
56
+ > **Requirements:** Python ≥ 3.9 · Google Chrome, Firefox, or Edge installed on your system.
57
+ > ChromeDriver / GeckoDriver are managed automatically by Selenium Manager (no manual download needed).
58
+
59
+ ---
60
+
61
+ ## Quick Start
62
+
63
+ ### Interactive wizard (recommended for new users)
64
+
65
+ Just run:
66
+
67
+ ```bash
68
+ gformbot
69
+ ```
70
+
71
+ The wizard will:
72
+ 1. Detect if you have a Google Form URL on your clipboard — press Enter to use it.
73
+ 2. Auto-inspect the form (opens a hidden browser for ~10 seconds).
74
+ 3. Ask if you have a response CSV pool.
75
+ 4. Let you set count, browser, and headless preferences with arrow-key menus.
76
+ 5. Show a sample response preview.
77
+ 6. Submit responses with a live progress bar.
78
+
79
+ ---
80
+
81
+ ## Subcommands (power-user / scriptable)
82
+
83
+ ### Inspect a form and generate a config
84
+
85
+ ```bash
86
+ gformbot inspect "https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform"
87
+ ```
88
+
89
+ This opens a headless browser, scrapes all questions and options, and writes `gformbot_config.yaml` to the current directory.
90
+
91
+ ---
92
+
93
+ ### Fill a form
94
+
95
+ ```bash
96
+ # Using wizard-generated config (auto-detected):
97
+ gformbot fill
98
+
99
+ # Explicit URL (auto-inspects and creates config):
100
+ gformbot fill "https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform"
101
+
102
+ # With all options:
103
+ gformbot fill \
104
+ --config my_config.yaml \
105
+ --count 25 \
106
+ --pool my_responses.csv \
107
+ --browser chrome \
108
+ --headless
109
+ ```
110
+
111
+ ---
112
+
113
+ ### Preview responses without submitting
114
+
115
+ ```bash
116
+ gformbot preview "https://..." --count 5
117
+ ```
118
+
119
+ ---
120
+
121
+ ### View or edit the config
122
+
123
+ ```bash
124
+ gformbot config --show # print to terminal
125
+ gformbot config --edit # open in $EDITOR
126
+ ```
127
+
128
+ ---
129
+
130
+ ### View the run log
131
+
132
+ ```bash
133
+ gformbot log
134
+ gformbot log --last 50
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Config File (`gformbot_config.yaml`)
140
+
141
+ Generated automatically by `gformbot inspect`. Customize it to set:
142
+
143
+ ```yaml
144
+ url: https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform
145
+ form_title: My Survey
146
+
147
+ # Optional: path to a CSV of real responses (relative or absolute)
148
+ pool_file: response_pool.csv
149
+
150
+ run_settings:
151
+ count: 10
152
+ browser: auto # auto | chrome | firefox | edge | headless
153
+ headless: false
154
+ min_delay: 0.25
155
+ max_delay: 0.75
156
+ max_runs: 500
157
+ log_file: gformbot_log.csv
158
+
159
+ questions:
160
+ - index: 1
161
+ text: "What best describes your main daily activity?"
162
+ type: radio
163
+ options:
164
+ - Studying
165
+ - Mostly indoor work
166
+ - A mix of indoor and outdoor work
167
+ - Mostly outdoor work
168
+ - Retired or not currently working
169
+ - Other
170
+ # Optional: bias weights (parallel to options list)
171
+ weights: [85, 5, 7, 1, 1, 1]
172
+
173
+ - index: 8
174
+ text: "Which kinds of places felt hottest?"
175
+ type: checkbox
176
+ max_select: 3 # pick at most 3
177
+ options:
178
+ - Roads, footpaths or crossings
179
+ - Bus stops or transport waiting areas
180
+ - No particular hot spot / not sure
181
+
182
+ - index: 14
183
+ text: "Optional: Name one public place that needs more shade."
184
+ type: textarea
185
+ # Fixed list of texts to randomly pick from:
186
+ text_pool:
187
+ - ""
188
+ - "college bus stop"
189
+ - "campus main gate area"
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Response Pool CSV
195
+
196
+ The CSV just needs columns that loosely match your form's question texts.
197
+ The tool auto-maps columns by matching question text prefixes — no manual mapping needed.
198
+
199
+ For multi-select questions, values in the CSV should be comma-separated:
200
+
201
+ ```
202
+ Q8 column value: "Roads, footpaths or crossings, Bus stops or transport waiting areas"
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Browser Support
208
+
209
+ | Browser | Status | Notes |
210
+ |---------|--------|-------|
211
+ | Chrome / Chromium | ✅ Full | Default. Incognito mode. |
212
+ | Firefox | ✅ Full | Private mode. |
213
+ | Edge | ✅ Full | InPrivate mode. |
214
+ | Headless | ✅ Full | Fastest. No window. Recommended for servers. |
215
+ | Auto | ✅ | Detects your system default browser. Falls back to Chrome. |
216
+
217
+ ---
218
+
219
+ ## Tips
220
+
221
+ - **`auto` browser mode** reads your OS default browser (Windows registry / macOS defaults / `xdg-settings`) and uses that. If detection fails or the browser isn't supported, it falls back to Chrome.
222
+ - **Headless** is recommended for unattended / server runs.
223
+ - **`max_runs`** in the config is a safety cap to prevent accidental mass submissions.
224
+ - The tool stops immediately on the first error and logs it — it will never silently fail in a loop.
225
+
226
+ ---
227
+
228
+ ## License
229
+
230
+ Apache 2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,194 @@
1
+ # gformbot
2
+
3
+ > **A general-purpose Google Form auto-filler CLI.**
4
+ > Inspect any form, supply a response pool (or let it generate synthetic answers), and submit at scale.
5
+
6
+ ---
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ pip install gformbot
12
+ ```
13
+
14
+ For clipboard URL detection (handy — just copy the form URL before running):
15
+
16
+ ```bash
17
+ pip install "gformbot[clipboard]"
18
+ ```
19
+
20
+ > **Requirements:** Python ≥ 3.9 · Google Chrome, Firefox, or Edge installed on your system.
21
+ > ChromeDriver / GeckoDriver are managed automatically by Selenium Manager (no manual download needed).
22
+
23
+ ---
24
+
25
+ ## Quick Start
26
+
27
+ ### Interactive wizard (recommended for new users)
28
+
29
+ Just run:
30
+
31
+ ```bash
32
+ gformbot
33
+ ```
34
+
35
+ The wizard will:
36
+ 1. Detect if you have a Google Form URL on your clipboard — press Enter to use it.
37
+ 2. Auto-inspect the form (opens a hidden browser for ~10 seconds).
38
+ 3. Ask if you have a response CSV pool.
39
+ 4. Let you set count, browser, and headless preferences with arrow-key menus.
40
+ 5. Show a sample response preview.
41
+ 6. Submit responses with a live progress bar.
42
+
43
+ ---
44
+
45
+ ## Subcommands (power-user / scriptable)
46
+
47
+ ### Inspect a form and generate a config
48
+
49
+ ```bash
50
+ gformbot inspect "https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform"
51
+ ```
52
+
53
+ This opens a headless browser, scrapes all questions and options, and writes `gformbot_config.yaml` to the current directory.
54
+
55
+ ---
56
+
57
+ ### Fill a form
58
+
59
+ ```bash
60
+ # Using wizard-generated config (auto-detected):
61
+ gformbot fill
62
+
63
+ # Explicit URL (auto-inspects and creates config):
64
+ gformbot fill "https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform"
65
+
66
+ # With all options:
67
+ gformbot fill \
68
+ --config my_config.yaml \
69
+ --count 25 \
70
+ --pool my_responses.csv \
71
+ --browser chrome \
72
+ --headless
73
+ ```
74
+
75
+ ---
76
+
77
+ ### Preview responses without submitting
78
+
79
+ ```bash
80
+ gformbot preview "https://..." --count 5
81
+ ```
82
+
83
+ ---
84
+
85
+ ### View or edit the config
86
+
87
+ ```bash
88
+ gformbot config --show # print to terminal
89
+ gformbot config --edit # open in $EDITOR
90
+ ```
91
+
92
+ ---
93
+
94
+ ### View the run log
95
+
96
+ ```bash
97
+ gformbot log
98
+ gformbot log --last 50
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Config File (`gformbot_config.yaml`)
104
+
105
+ Generated automatically by `gformbot inspect`. Customize it to set:
106
+
107
+ ```yaml
108
+ url: https://docs.google.com/forms/d/e/YOUR_FORM_ID/viewform
109
+ form_title: My Survey
110
+
111
+ # Optional: path to a CSV of real responses (relative or absolute)
112
+ pool_file: response_pool.csv
113
+
114
+ run_settings:
115
+ count: 10
116
+ browser: auto # auto | chrome | firefox | edge | headless
117
+ headless: false
118
+ min_delay: 0.25
119
+ max_delay: 0.75
120
+ max_runs: 500
121
+ log_file: gformbot_log.csv
122
+
123
+ questions:
124
+ - index: 1
125
+ text: "What best describes your main daily activity?"
126
+ type: radio
127
+ options:
128
+ - Studying
129
+ - Mostly indoor work
130
+ - A mix of indoor and outdoor work
131
+ - Mostly outdoor work
132
+ - Retired or not currently working
133
+ - Other
134
+ # Optional: bias weights (parallel to options list)
135
+ weights: [85, 5, 7, 1, 1, 1]
136
+
137
+ - index: 8
138
+ text: "Which kinds of places felt hottest?"
139
+ type: checkbox
140
+ max_select: 3 # pick at most 3
141
+ options:
142
+ - Roads, footpaths or crossings
143
+ - Bus stops or transport waiting areas
144
+ - No particular hot spot / not sure
145
+
146
+ - index: 14
147
+ text: "Optional: Name one public place that needs more shade."
148
+ type: textarea
149
+ # Fixed list of texts to randomly pick from:
150
+ text_pool:
151
+ - ""
152
+ - "college bus stop"
153
+ - "campus main gate area"
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Response Pool CSV
159
+
160
+ The CSV just needs columns that loosely match your form's question texts.
161
+ The tool auto-maps columns by matching question text prefixes — no manual mapping needed.
162
+
163
+ For multi-select questions, values in the CSV should be comma-separated:
164
+
165
+ ```
166
+ Q8 column value: "Roads, footpaths or crossings, Bus stops or transport waiting areas"
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Browser Support
172
+
173
+ | Browser | Status | Notes |
174
+ |---------|--------|-------|
175
+ | Chrome / Chromium | ✅ Full | Default. Incognito mode. |
176
+ | Firefox | ✅ Full | Private mode. |
177
+ | Edge | ✅ Full | InPrivate mode. |
178
+ | Headless | ✅ Full | Fastest. No window. Recommended for servers. |
179
+ | Auto | ✅ | Detects your system default browser. Falls back to Chrome. |
180
+
181
+ ---
182
+
183
+ ## Tips
184
+
185
+ - **`auto` browser mode** reads your OS default browser (Windows registry / macOS defaults / `xdg-settings`) and uses that. If detection fails or the browser isn't supported, it falls back to Chrome.
186
+ - **Headless** is recommended for unattended / server runs.
187
+ - **`max_runs`** in the config is a safety cap to prevent accidental mass submissions.
188
+ - The tool stops immediately on the first error and logs it — it will never silently fail in a loop.
189
+
190
+ ---
191
+
192
+ ## License
193
+
194
+ Apache 2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,6 @@
1
+ """
2
+ gformbot — A general-purpose Google Form auto-filler CLI.
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+ __author__ = "yogeshkrishna"
@@ -0,0 +1,3 @@
1
+ """Allow `python -m gformbot` invocation."""
2
+ from gformbot.cli import main
3
+ main()