Skip to content

Commit

Permalink
Merge pull request #1382 from burnash/feature/release_6_0_0
Browse files Browse the repository at this point in the history
Feature/release 6 0 0
  • Loading branch information
lavigne958 committed Jan 27, 2024
2 parents 222817f + 2c4d117 commit 2dd69eb
Show file tree
Hide file tree
Showing 48 changed files with 9,368 additions and 11,560 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.x"]
python: ["3.8", "3.9", "3.10", "3.11", "3.x"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -29,7 +29,6 @@ jobs:
if: ${{ matrix.python >= '3.8' }}
- run: tox -e lint
- run: tox -e py
- run: mypy --install-types --ignore-missing-imports . || true
- run: shopt -s globstar && pyupgrade --py3-only **/*.py # --py36-plus
- run: safety check -i 42559 -i 62044 # pip <= 20.1.1, we upgrade it just above
- run: tox -e build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Setup tox
run: pip install tox
- name: Run linter
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Features:
pip install gspread
```

Requires Python 3.7+
Requirements: Python 3.8+.

## Basic Usage

Expand Down Expand Up @@ -190,22 +190,30 @@ values_list = worksheet.col_values(1)
### Getting All Values From a Worksheet as a List of Lists

```python
list_of_lists = worksheet.get_values()
from gspread.utils import GridRangeType
list_of_lists = worksheet.get(return_type=GridRangeType.ListOfLists)
```

### Getting a range of values

Receive only the cells with a value in them
Receive only the cells with a value in them.

```python
>>> worksheet.get_values("A1:B4")
>>> worksheet.get("A1:B4")
[['A1', 'B1'], ['A2']]
```

Receive a lists of lists matching the requested size
regardless if values are empty or not
Receive a rectangular array around the cells with values in them.

```python
>>> worksheet.get("A1:B4", pad_values=True)
[['A1', 'B1'], ['A2', '']]
```

Receive an array matching the request size regardless of if values are empty or not.

```python
>>> worksheet.get_values("A1:B4", maintain_size=True)
>>> worksheet.get("A1:B4", maintain_size=True)
[['A1', 'B1'], ['A2', ''], ['', ''], ['', '']]
```

Expand Down
3 changes: 0 additions & 3 deletions docs/api/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ Client

.. autoclass:: gspread.Client
:members:

.. autoclass:: gspread.client.BackoffClient
:members:
13 changes: 13 additions & 0 deletions docs/api/http_client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
HTTP Client
===========

.. note::

This class is not intended to be used directly.
It is used by all gspread models to interact with the Google API

.. autoclass:: gspread.HTTPClient
:members:

.. autoclass:: gspread.BackOffHTTPClient
:members:
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ API Reference
top-level
auth
client
http_client
models/index
utils
exceptions
10 changes: 0 additions & 10 deletions docs/api/utils.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
Utils
=====

.. autonamedtuple:: gspread.utils.Dimension
.. autonamedtuple:: gspread.utils.DateTimeOption
.. autonamedtuple:: gspread.utils.ExportFormat
.. autonamedtuple:: gspread.utils.MergeType
.. autonamedtuple:: gspread.utils.MimeType
.. autonamedtuple:: gspread.utils.PasteOrientation
.. autonamedtuple:: gspread.utils.PasteType
.. autonamedtuple:: gspread.utils.ValueInputOption
.. autonamedtuple:: gspread.utils.ValueRenderOption

.. automodule:: gspread.utils
:members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==5.3.0
sphinx==6.2.1
sphinx_rtd_theme
sphinx-toolbox
7 changes: 4 additions & 3 deletions gspread/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Google Spreadsheets Python API"""

__version__ = "5.12.4"
__version__ = "6.0.0"
__author__ = "Anton Burnashev"


Expand All @@ -12,13 +12,14 @@
service_account_from_dict,
)
from .cell import Cell
from .client import BackoffClient, Client, ClientFactory
from .client import Client
from .exceptions import (
GSpreadException,
IncorrectCellLabel,
NoValidUrlKeyFound,
SpreadsheetNotFound,
WorksheetNotFound,
)
from .http_client import BackOffHTTPClient, HTTPClient
from .spreadsheet import Spreadsheet
from .worksheet import Worksheet
from .worksheet import ValueRange, Worksheet
Loading

0 comments on commit 2dd69eb

Please sign in to comment.