Skip to content

Comments

Add Google Forms API integration for questionnaire import (closes #36)#126

Open
antuansabe wants to merge 1 commit intoharmonydata:mainfrom
antuansabe:feature/google-forms-integration
Open

Add Google Forms API integration for questionnaire import (closes #36)#126
antuansabe wants to merge 1 commit intoharmonydata:mainfrom
antuansabe:feature/google-forms-integration

Conversation

@antuansabe
Copy link

Implements complete Google Forms API integration allowing users to import questionnaires directly from Google Forms URLs using simple API key authentication.

Features:

  • URL and form ID parsing with regex pattern matching
  • Google Forms API v1 integration using google-api-python-client
  • Support for multiple question types: multiple choice, checkboxes, dropdown, linear scale, text questions, and grid questions
  • Automatic language detection using langdetect
  • Comprehensive metadata extraction (form_id, title, description)
  • Complete test suite with mock data for testing without API calls
  • Documentation in README.md with setup instructions and usage examples

Technical details:

  • Authentication: API key via GOOGLE_FORMS_API_KEY environment variable
  • New FileType: google_forms enum value
  • Parser pattern: convert_google_forms_to_instruments(file: RawFile) -> List[Instrument]
  • Error handling for HttpError (403, 404, 429) and invalid inputs

Files added:

  • src/harmony/parsing/google_forms_parser.py (~350 lines)
  • tests/test_google_forms_parser.py (comprehensive test suite)

Files modified:

  • requirements.txt: Added google-api-python-client>=2.147.0
  • pyproject.toml: Added google-api-python-client dependency
  • src/harmony/schemas/enums/file_types.py: Added google_forms enum
  • src/harmony/parsing/wrapper_all_parsers.py: Added import and routing
  • README.md: Added Google Forms documentation section

…monydata#36)

Implements complete Google Forms API integration allowing users to import
questionnaires directly from Google Forms URLs using simple API key authentication.

Features:
- URL and form ID parsing with regex pattern matching
- Google Forms API v1 integration using google-api-python-client
- Support for multiple question types: multiple choice, checkboxes, dropdown,
  linear scale, text questions, and grid questions
- Automatic language detection using langdetect
- Comprehensive metadata extraction (form_id, title, description)
- Complete test suite with mock data for testing without API calls
- Documentation in README.md with setup instructions and usage examples

Technical details:
- Authentication: API key via GOOGLE_FORMS_API_KEY environment variable
- New FileType: google_forms enum value
- Parser pattern: convert_google_forms_to_instruments(file: RawFile) -> List[Instrument]
- Error handling for HttpError (403, 404, 429) and invalid inputs

Files added:
- src/harmony/parsing/google_forms_parser.py (~350 lines)
- tests/test_google_forms_parser.py (comprehensive test suite)

Files modified:
- requirements.txt: Added google-api-python-client>=2.147.0
- pyproject.toml: Added google-api-python-client dependency
- src/harmony/schemas/enums/file_types.py: Added google_forms enum
- src/harmony/parsing/wrapper_all_parsers.py: Added import and routing
- README.md: Added Google Forms documentation section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant