Skip to content

feat: convert office uploads to native Google types (xlsx -> Google Sheet) - #3

Merged
thorwhalen merged 1 commit into
masterfrom
feat/google-native-convert
Jul 28, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
feat/google-native-convert

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Adds opt-in conversion of office uploads to native Google editor types.

  • GOOGLE_MIME: office extension -> Google-native editor mimetype map (.xlsx/.xls/.csv -> Sheet, .docx/.doc -> Doc, .pptx/.ppt -> Slides)
  • _upload_converting(...): create/update a Drive file from bytes or a path, optionally converting
  • xlsx_to_google_sheet(...): upload an .xlsx as a native Google Sheet, returns the URL
  • tests/test_convert.py: 4 tests, all passing

Provenance

This work was written on 2026-06-19 and had been sitting unpushed on a local
machine only. Rebased onto current master; the single conflict was an add/add
against drive_from_service_account (both additions kept, they are independent).

Verification

  • pytest tests/ -> 4 passed
  • pytest --doctest-modules pydrivedol/ -> same 2 pre-existing test_service_account.py
    failures as clean master, no new failures introduced

…heet)

- _upload_converting(): create/update a Drive file from bytes or path, optionally
  converting to the Google editor format (xlsx->Sheet, docx->Doc, pptx->Slides).
- GDStore.upload(key, value, *, convert=True) + GDStore(convert_office=True) flag.
- xlsx_to_google_sheet(folder_url, title, xlsx, *, share_with, anyone_reader) -> URL.
- Unit tests with an injected fake drive (no PyDrive2 / no network needed).

Claude-Session: https://claude.ai/code/session_01LUpTPcgooABkgUSNXD2Xjy
@thorwhalen
thorwhalen merged commit aded444 into master Jul 28, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the feat/google-native-convert branch July 28, 2026 18:50
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