pyixapi 0.2.5__tar.gz → 0.2.7__tar.gz

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.
@@ -1,23 +1,24 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pyixapi
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Python API client library for IX-API
5
- License: Apache-2.0
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
6
7
  Author: Guillaume Mazoyer
7
8
  Author-email: oss@mazoyer.eu
8
- Requires-Python: >=3.9
9
+ Requires-Python: >=3.10
9
10
  Classifier: Intended Audience :: Developers
10
11
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
16
17
  Provides-Extra: dev
17
18
  Requires-Dist: PyJWT (>=2.4.0,<2.11)
18
19
  Requires-Dist: pytest ; extra == "dev"
19
- Requires-Dist: requests (>=2.20.0,<3.0)
20
- Requires-Dist: ruff (>=0.9,<0.10) ; extra == "dev"
20
+ Requires-Dist: requests (>=2.32.4,<3.0)
21
+ Requires-Dist: ruff (>=0.14,<0.15) ; extra == "dev"
21
22
  Description-Content-Type: text/markdown
22
23
 
23
24
  # pyixapi
@@ -26,7 +27,7 @@ Python API client library for [IX-API](https://ix-api.net/).
26
27
 
27
28
  Supported versions are:
28
29
 
29
- * [version 1](https://docs.ix-api.net/v1/)
30
+ * [version 1](https://docs.ix-api.net/v1/) -- deprecated, providers cease date is 2026-07-01
30
31
  * [version 2](https://docs.ix-api.net/v2/)
31
32
 
32
33
  ## Installation
@@ -40,7 +41,7 @@ To begin, import pyixapi and instantiate the API.
40
41
  ```python
41
42
  import pyixapi
42
43
  ixapi = pyixapi.api(
43
- "https://api.de-cix.net/api/v1/",
44
+ "https://api.de-cix.net/api/v2/",
44
45
  "3LH3G72VH7H1SGogEsFeQOPsGjOQotMUZQRt2pK7YbH",
45
46
  "cEtrt8s0vR0CsG0vpAmcaxtnolzZj7DEG0B7izvwPlV",
46
47
  )
@@ -4,7 +4,7 @@ Python API client library for [IX-API](https://ix-api.net/).
4
4
 
5
5
  Supported versions are:
6
6
 
7
- * [version 1](https://docs.ix-api.net/v1/)
7
+ * [version 1](https://docs.ix-api.net/v1/) -- deprecated, providers cease date is 2026-07-01
8
8
  * [version 2](https://docs.ix-api.net/v2/)
9
9
 
10
10
  ## Installation
@@ -18,7 +18,7 @@ To begin, import pyixapi and instantiate the API.
18
18
  ```python
19
19
  import pyixapi
20
20
  ixapi = pyixapi.api(
21
- "https://api.de-cix.net/api/v1/",
21
+ "https://api.de-cix.net/api/v2/",
22
22
  "3LH3G72VH7H1SGogEsFeQOPsGjOQotMUZQRt2pK7YbH",
23
23
  "cEtrt8s0vR0CsG0vpAmcaxtnolzZj7DEG0B7izvwPlV",
24
24
  )
@@ -1,3 +1,5 @@
1
+ import warnings
2
+
1
3
  import requests
2
4
 
3
5
  from pyixapi.core.endpoint import Endpoint
@@ -29,7 +31,7 @@ from pyixapi.models import (
29
31
  RoleAssignment,
30
32
  )
31
33
 
32
- __version__ = "0.2.5"
34
+ __version__ = "0.2.7"
33
35
 
34
36
 
35
37
  class API(object):
@@ -82,11 +84,11 @@ class API(object):
82
84
  self.role_assignments = Endpoint(self, "role-assignments", model=RoleAssignment)
83
85
 
84
86
  @property
85
- def version(self):
87
+ def version(self) -> int:
86
88
  """
87
89
  Get the API version of IX-API.
88
90
  """
89
- return Request(
91
+ version = Request(
90
92
  base=self.url,
91
93
  token=self.access_token,
92
94
  http_session=self.http_session,
@@ -94,6 +96,15 @@ class API(object):
94
96
  proxies=self.proxies,
95
97
  ).get_version()
96
98
 
99
+ if version == 1:
100
+ warnings.warn(
101
+ "IX-API version 1 is deprecated and will not be supported in future releases of pyixapi.",
102
+ DeprecationWarning,
103
+ stacklevel=2,
104
+ )
105
+
106
+ return version
107
+
97
108
  @property
98
109
  def accounts(self):
99
110
  return Endpoint(self, "customers" if self.version == 1 else "accounts", model=Account)
@@ -97,7 +97,7 @@ class Request(object):
97
97
 
98
98
  Issue a GET request to the health endpoint to read the API version.
99
99
 
100
- If a RequestError is raised, it is catched and the version is considered as
100
+ If a RequestError is raised, it is caught and the version is considered as
101
101
  equal to 1 (IX-API v1 does not have a health endpoint).
102
102
  """
103
103
  try:
@@ -127,6 +127,9 @@ class Request(object):
127
127
  if self.token:
128
128
  headers["Authorization"] = f"Bearer {self.token}"
129
129
 
130
+ if self.user_agent:
131
+ headers["User-Agent"] = self.user_agent
132
+
130
133
  params = {}
131
134
  if not url_override:
132
135
  if self.filters:
@@ -139,7 +142,6 @@ class Request(object):
139
142
  headers=headers,
140
143
  params=params,
141
144
  json=data,
142
- user_agent=self.user_agent,
143
145
  proxies=self.proxies,
144
146
  )
145
147
 
@@ -1,24 +1,24 @@
1
1
  [project]
2
2
  name = "pyixapi"
3
- version = "0.2.5"
3
+ version = "0.2.7"
4
4
  description = "Python API client library for IX-API"
5
5
  authors = [{ name = "Guillaume Mazoyer", email = "oss@mazoyer.eu" }]
6
6
  readme = "README.md"
7
7
  license = "Apache-2.0"
8
- requires-python = ">=3.9"
8
+ requires-python = ">=3.10"
9
9
  classifiers = [
10
10
  "Intended Audience :: Developers",
11
11
  "Programming Language :: Python :: 3",
12
- "Programming Language :: Python :: 3.9",
13
12
  "Programming Language :: Python :: 3.10",
14
13
  "Programming Language :: Python :: 3.11",
15
14
  "Programming Language :: Python :: 3.12",
16
15
  "Programming Language :: Python :: 3.13",
16
+ "Programming Language :: Python :: 3.14",
17
17
  ]
18
- dependencies = ["PyJWT>=2.4.0,<2.11", "requests>=2.20.0,<3.0"]
18
+ dependencies = ["PyJWT>=2.4.0,<2.11", "requests>=2.32.4,<3.0"]
19
19
 
20
20
  [project.optional-dependencies]
21
- dev = ["pytest", "ruff>=0.9,<0.10"]
21
+ dev = ["pytest", "ruff>=0.14,<0.15"]
22
22
 
23
23
  [tool.poetry]
24
24
  requires-poetry = ">=2.0"
File without changes
File without changes
File without changes
File without changes
File without changes