deezer-python 6.1.1__py3-none-any.whl → 6.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
deezer/__init__.py CHANGED
@@ -15,7 +15,7 @@ from deezer.resources import (
15
15
  User,
16
16
  )
17
17
 
18
- __version__ = "6.1.1"
18
+ __version__ = "6.2.0"
19
19
  __all__ = [
20
20
  "Album",
21
21
  "Artist",
deezer/client.py CHANGED
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import warnings
3
4
  from typing import Any, ClassVar
4
5
 
5
6
  import requests
@@ -25,6 +26,8 @@ from deezer.resources import (
25
26
  User,
26
27
  )
27
28
 
29
+ _UNSET = object()
30
+
28
31
 
29
32
  class Client:
30
33
  """
@@ -34,7 +37,7 @@ class Client:
34
37
  be passed in to the constructor as kwargs.
35
38
 
36
39
  >>> import deezer
37
- >>> client = deezer.Client(app_id='foo', app_secret='bar')
40
+ >>> client = deezer.Client()
38
41
 
39
42
  This client provides several methods to retrieve the content most
40
43
  kinds of Deezer objects, based on their json structure.
@@ -45,10 +48,17 @@ class Client:
45
48
  >>> import deezer
46
49
  >>> client = deezer.Client(headers={'Accept-Language': 'fr'})
47
50
 
48
- :param app_id: application ID.
49
- :param app_secret: application secret.
50
51
  :param access_token: user access token.
51
52
  :param headers: a dictionary of headers to be used.
53
+
54
+ .. deprecated:: 6.2.0
55
+
56
+ The following parameters will be removed in the next major version:
57
+
58
+ * **app_id**
59
+ * **app_secret**
60
+
61
+ They were never actively used by the package.
52
62
  """
53
63
 
54
64
  objects_types: ClassVar[dict[str, type[Resource] | None]] = {
@@ -69,10 +79,29 @@ class Client:
69
79
  base_url = "https://api.deezer.com"
70
80
 
71
81
  def __init__(
72
- self, app_id=None, app_secret=None, access_token=None, headers=None, **kwargs
82
+ self,
83
+ app_id=_UNSET,
84
+ app_secret=_UNSET,
85
+ access_token=None,
86
+ headers=None,
87
+ **kwargs,
73
88
  ):
74
- self.app_id = app_id
75
- self.app_secret = app_secret
89
+ if app_id is not _UNSET:
90
+ warnings.warn(
91
+ "The 'app_id' parameter is not actually used and is deprecated. "
92
+ "It will be removed in the next major release.",
93
+ DeprecationWarning,
94
+ stacklevel=2,
95
+ )
96
+ self.app_id = app_id
97
+ if app_secret is not _UNSET:
98
+ warnings.warn(
99
+ "The 'app_secret' parameter is not actually used and is deprecated. "
100
+ "It will be removed in the next major release.",
101
+ DeprecationWarning,
102
+ stacklevel=2,
103
+ )
104
+ self.app_secret = app_secret
76
105
  self.access_token = access_token
77
106
  self.session = requests.Session()
78
107
 
@@ -166,7 +195,7 @@ class Client:
166
195
  json_data = response.json()
167
196
  if not isinstance(json_data, dict):
168
197
  return json_data
169
- if "error" in json_data and json_data["error"]:
198
+ if json_data.get("error"):
170
199
  raise DeezerErrorResponse(json_data)
171
200
  return self._process_json(
172
201
  json_data,
deezer/pagination.py CHANGED
@@ -41,12 +41,10 @@ class PaginatedList(Generic[ResourceType]):
41
41
  return f"<{self.__class__.__name__} {data!r}>"
42
42
 
43
43
  @overload
44
- def __getitem__(self, index: int) -> ResourceType:
45
- ...
44
+ def __getitem__(self, index: int) -> ResourceType: ...
46
45
 
47
46
  @overload
48
- def __getitem__(self, index: slice) -> list[ResourceType]:
49
- ...
47
+ def __getitem__(self, index: slice) -> list[ResourceType]: ...
50
48
 
51
49
  def __getitem__(
52
50
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deezer-python
3
- Version: 6.1.1
3
+ Version: 6.2.0
4
4
  Summary: A friendly wrapper library for the Deezer API
5
5
  Home-page: https://github.com/browniebroke/deezer-python
6
6
  License: MIT
@@ -89,7 +89,7 @@ The package is published on
89
89
  Easily query the Deezer API from you Python code. The data returned by the Deezer
90
90
  API is mapped to python resources:
91
91
 
92
- ```python
92
+ ```pycon
93
93
  >>> client = deezer.Client()
94
94
  >>> client.get_album(680407).title
95
95
  'Monkey Business'
@@ -1,8 +1,8 @@
1
- deezer/__init__.py,sha256=ni5SDN4LA1uGUENEoScDGcDH69z-Q1_k4pcguCB8t-k,556
2
- deezer/client.py,sha256=4fyvBflMzql0MHVg1pkZzq8ANHNRWjyQwYuaYmg_Vlc,24896
1
+ deezer/__init__.py,sha256=ohzXzQw4o6AhcuubYDivDtiJMIxd_Q69OU2opi4W4Os,556
2
+ deezer/client.py,sha256=Xr_NDiVUT5b-YIkzfresHd76GWrUEgE-MeLYhI7TEKI,25651
3
3
  deezer/dates.py,sha256=raTeUAAOkajl0TTzM2cupzieTY0amzTeZCaaT3gp_iU,648
4
4
  deezer/exceptions.py,sha256=LmJ9vU_mRQ9o9T26ihD36cIMWMC1lg4sBBLiKta3pQA,2003
5
- deezer/pagination.py,sha256=toiLE51UgiRN1hEUetdeTnaovXjLF6NUjU0TJFaTO-w,4057
5
+ deezer/pagination.py,sha256=MrlUiuKczEHb0bdThwzG9y48M30F4AaobhvReJHzWx8,4041
6
6
  deezer/resources/__init__.py,sha256=WLHWGhV5rLyzZe9IjAtVWUsLvNJDWoldgE2JIADC0L4,549
7
7
  deezer/resources/album.py,sha256=83PXZNSSkxY7qVVgyvgyHceaV4IMoQxfqcbTR5v-l38,1734
8
8
  deezer/resources/artist.py,sha256=A2mZDceh82cQOsMl3cczgm97UCCUHehNeoPYR8IWjds,2150
@@ -17,7 +17,7 @@ deezer/resources/resource.py,sha256=X_65glzz62jHtVB2U-WtuXM8B5E9U2HbjpcRzOdVOiY,
17
17
  deezer/resources/track.py,sha256=e3DPTsYWq5yNCjMRQhGTrFQHfQUe3xn0mEVYbpL3O_0,1546
18
18
  deezer/resources/user.py,sha256=6-46PX80xEgtCY2FecwzzgbvYu1aL1WShFXcCOaVGlU,6752
19
19
  deezer/utils.py,sha256=Z4QA5Ud5KPiGGv5buTdUidixmkEF9UhwCoYZiGXE-cE,583
20
- deezer_python-6.1.1.dist-info/LICENSE.txt,sha256=lGqKEubFaPBoiJVRoHOxg1LYlte1e5kLoq6zWUSRQzQ,1054
21
- deezer_python-6.1.1.dist-info/METADATA,sha256=CclxgkmjcPUVmJAsmCAGigoX4OJtmEaNv2i7hziIMRE,14630
22
- deezer_python-6.1.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
23
- deezer_python-6.1.1.dist-info/RECORD,,
20
+ deezer_python-6.2.0.dist-info/LICENSE.txt,sha256=lGqKEubFaPBoiJVRoHOxg1LYlte1e5kLoq6zWUSRQzQ,1054
21
+ deezer_python-6.2.0.dist-info/METADATA,sha256=4POY_crEa5ogOvMKiy6cmuSbFqwi2ON6khahRQWFw8Y,14629
22
+ deezer_python-6.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
23
+ deezer_python-6.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.7.0
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any