Skip to content

Commit

Permalink
Documentation for client options
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hilden committed Feb 26, 2020
1 parent 8a24ca3 commit 42169aa
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/documents/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,40 @@ so the new recent token should be used instead.
The most recent refresh token is always returned when refreshing a token,
but any saved refresh tokens need to be updated too.

Client options
--------------
The :mod:`client <tekore.client>` provides options and toggles
to customise behavior in a variety of ways.

Maximise limits
***************
The Web API limits the number of resources returned in many endpoints.
By default, these limits are below their maximum values, matching API defaults.
However, they can be maximised when instantiating a client or as a context.

.. code:: python
spotify = Spotify(max_limits_on=True)
spotify.max_limits_on = False
with spotify.max_limits():
tracks = spotify.all_items(spotify.search('piano')[0])
Chunked requests
****************
Endpoints that accept lists of resources often limit
the amount of items that can be passed in.
To help with this restriction, those lists can be chunked.

.. code:: python
spotify = Spotify(chunked_on=True)
spotify.chunked_on = False
with spotify.chunked():
# Go nuts with e.g. spotify.artists_follow
Application configuration
-------------------------
Should you want to use environment variables or configuration files
Expand Down

0 comments on commit 42169aa

Please sign in to comment.