spreadsheetforms
raw JSON → 0.5.0 verified Sat May 09 auth: no python
Tools for creating, extracting submitted data from, and filling spreadsheet-based forms. Current version 0.5.0, requires Python >=3.7. Release cadence is irregular.
pip install spreadsheetforms Common errors
error ModuleNotFoundError: No module named 'spreadsheet_forms' ↓
cause Trying to import with hyphen instead of underscore.
fix
Change import to 'import spreadsheetforms' (no hyphen).
error AttributeError: 'Form' object has no attribute 'data' ↓
cause Attempting to access `form.data` without extracting data during load.
fix
Use
form = Form.from_file('file.xlsx', extract_data=True). Data is stored as form.data after extraction. Warnings
gotcha The package name contains a hyphen (spreadsheetforms) but the module import uses an underscore (spreadsheetforms). PyPI does not enforce naming consistency. ↓
fix Use 'pip install spreadsheetforms' but 'import spreadsheetforms'.
breaking Version 0.4.0 changed the API for extracting submitted data: `Form.from_file()` now requires `extract_data=True` to parse data; previous versions extracted automatically. ↓
fix Call `Form.from_file('submission.xlsx', extract_data=True)` to get form with data.
gotcha Form.to_file() overwrites existing files without warning. No prompt or backup is created. ↓
fix Check file existence before calling to_file or ensure you have backups.
Imports
- Form wrong
from spreadsheet_forms import Formcorrectfrom spreadsheetforms import Form - FormData
from spreadsheetforms import FormData - SheetSpec
from spreadsheetforms.sheets import SheetSpec
Quickstart
from spreadsheetforms import Form
from spreadsheetforms.sheets import SheetSpec
# Define a simple form
form = Form(
sheets=[
SheetSpec(
name='Questions',
columns=['Question', 'Answer']
)
]
)
# Generate a blank spreadsheet
form.to_file('my_form.xlsx')