Skip to content

Commit

Permalink
update migration guide
Browse files Browse the repository at this point in the history
add `Worksheet.__init__` change
hide "rarer" changes under <details> so users are not overwhelmed by changes,
and can get to "more examples" easier
  • Loading branch information
alifeee committed Feb 6, 2024
1 parent cb1a63e commit af9eb4a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ As well, `values` can no longer be a list, and must be a 2D array.
+ file.sheet1.update(range_name="B2:C2", values=[["54", "55"]])
```

### More

<details><summary>See More Migration Guide</summary>

### Change colors from dictionary to text

v6 uses hexadecimal color representation. Change all colors to hex. You can use the compatibility function `gspread.utils.convert_colors_to_hex_value()` to convert a dictionary to a hex string.
Expand Down Expand Up @@ -107,6 +111,18 @@ In v6 you can now only get *all* sheet records, using `Worksheet.get_all_records
In version 5 there are many warnings to mark deprecated feature/functions/methods.
They can be silenced by setting the `GSPREAD_SILENCE_WARNINGS` environment variable to `1`

### Add more data to `gspread.Worksheet.__init__`

```diff
gc = gspread.service_account(filename="google_credentials.json")
spreadsheet = gc.open_by_key("{{key}}")
properties = spreadsheet.fetch_sheet_metadata()["sheets"][0]["properties"]
- worksheet = gspread.Worksheet(spreadsheet, properties)
+ worksheet = gspread.Worksheet(spreadsheet, properties, spreadsheet.id, gc.http_client)
```

</details>

## More Examples

### Opening a Spreadsheet
Expand Down

0 comments on commit af9eb4a

Please sign in to comment.