python-epo-ops-client 4.2.1__py3-none-any.whl → 4.2.2__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.
- epo_ops/api.py +15 -9
- epo_ops/models.py +1 -1
- {python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/METADATA +16 -11
- {python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/RECORD +7 -7
- {python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/WHEEL +1 -1
- {python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/licenses/LICENSE +0 -0
- {python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/top_level.txt +0 -0
epo_ops/api.py
CHANGED
|
@@ -10,18 +10,13 @@ from requests.exceptions import HTTPError
|
|
|
10
10
|
|
|
11
11
|
from . import exceptions
|
|
12
12
|
from .middlewares import Throttler
|
|
13
|
-
from .models import
|
|
14
|
-
AccessToken,
|
|
15
|
-
Docdb,
|
|
16
|
-
Epodoc,
|
|
17
|
-
Original,
|
|
18
|
-
Request,
|
|
19
|
-
)
|
|
13
|
+
from .models import AccessToken, Docdb, Epodoc, Original, Request
|
|
20
14
|
|
|
21
15
|
log = logging.getLogger(__name__)
|
|
22
16
|
|
|
23
17
|
DEFAULT_NETWORK_TIMEOUT = 10.0
|
|
24
18
|
|
|
19
|
+
|
|
25
20
|
class Client(object):
|
|
26
21
|
__auth_url__ = "https://ops.epo.org/3.2/auth/accesstoken"
|
|
27
22
|
__service_url_prefix__ = "https://ops.epo.org/3.2/rest-services"
|
|
@@ -35,7 +30,15 @@ class Client(object):
|
|
|
35
30
|
__register_path__ = "register"
|
|
36
31
|
__register_search_path__ = "register/search"
|
|
37
32
|
|
|
38
|
-
def __init__(
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
key,
|
|
36
|
+
secret,
|
|
37
|
+
accept_type="xml",
|
|
38
|
+
middlewares=None,
|
|
39
|
+
timeout=DEFAULT_NETWORK_TIMEOUT,
|
|
40
|
+
raise_for_status=True,
|
|
41
|
+
):
|
|
39
42
|
self.accept_type = "application/{0}".format(accept_type)
|
|
40
43
|
self.middlewares = middlewares
|
|
41
44
|
if middlewares is None:
|
|
@@ -44,6 +47,7 @@ class Client(object):
|
|
|
44
47
|
self.key = key
|
|
45
48
|
self.secret = secret
|
|
46
49
|
self.timeout = timeout
|
|
50
|
+
self.raise_for_status = raise_for_status
|
|
47
51
|
self._access_token = None
|
|
48
52
|
|
|
49
53
|
def family(
|
|
@@ -154,6 +158,7 @@ class Client(object):
|
|
|
154
158
|
input=input,
|
|
155
159
|
)
|
|
156
160
|
)
|
|
161
|
+
|
|
157
162
|
def number(
|
|
158
163
|
self,
|
|
159
164
|
reference_type: str,
|
|
@@ -395,7 +400,8 @@ class Client(object):
|
|
|
395
400
|
)
|
|
396
401
|
response = self._check_for_expired_token(response)
|
|
397
402
|
response = self._check_for_exceeded_quota(response)
|
|
398
|
-
|
|
403
|
+
if self.raise_for_status:
|
|
404
|
+
response.raise_for_status()
|
|
399
405
|
return response
|
|
400
406
|
|
|
401
407
|
# info: {
|
epo_ops/models.py
CHANGED
|
@@ -10,6 +10,7 @@ from .utils import quote, validate_date
|
|
|
10
10
|
|
|
11
11
|
log = logging.getLogger(__name__)
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
def _prepare_part(part):
|
|
14
15
|
return "({0})".format(quote(part))
|
|
15
16
|
|
|
@@ -107,7 +108,6 @@ class Request(object):
|
|
|
107
108
|
self.reset_env()
|
|
108
109
|
return response
|
|
109
110
|
|
|
110
|
-
|
|
111
111
|
def _post_callback(self, url, data, **kwargs):
|
|
112
112
|
return requests.post(url, data, **kwargs, timeout=self.timeout)
|
|
113
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-epo-ops-client
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.2
|
|
4
4
|
Summary: Python client for EPO OPS, the European Patent Office's Open Patent Services API.
|
|
5
5
|
Home-page: https://github.com/ip-tools/python-epo-ops-client
|
|
6
6
|
Download-URL: https://pypi.org/project/python-epo-ops-client/#files
|
|
@@ -8,11 +8,11 @@ Author: George Song
|
|
|
8
8
|
Author-email: george@monozuku.com
|
|
9
9
|
Maintainer: Andreas Motl
|
|
10
10
|
Maintainer-email: andreas.motl@ip-tools.org
|
|
11
|
+
License: Apache-2.0
|
|
11
12
|
Keywords: ops,epo,epo-ops,patent-data,patent-office,patent-data-api,european patent office,open patent services
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Intended Audience :: Developers
|
|
14
15
|
Classifier: Natural Language :: English
|
|
15
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
16
|
Classifier: Programming Language :: Python
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.6
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -22,25 +22,27 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
26
|
Classifier: Topic :: Software Development :: Libraries
|
|
26
27
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
28
|
Description-Content-Type: text/markdown
|
|
28
29
|
License-File: LICENSE
|
|
29
|
-
Requires-Dist: dogpile.cache<1.
|
|
30
|
+
Requires-Dist: dogpile.cache<1.6
|
|
30
31
|
Requires-Dist: importlib-metadata; python_version < "3.8"
|
|
31
32
|
Requires-Dist: python-dateutil<2.10
|
|
32
33
|
Requires-Dist: requests<3,>=2.27
|
|
33
34
|
Requires-Dist: six<2
|
|
34
35
|
Provides-Extra: develop
|
|
35
|
-
Requires-Dist:
|
|
36
|
+
Requires-Dist: pyproject-fmt<3; extra == "develop"
|
|
37
|
+
Requires-Dist: ruff<0.16; python_version >= "3.7" and extra == "develop"
|
|
36
38
|
Requires-Dist: twine<7; extra == "develop"
|
|
37
39
|
Requires-Dist: wheel<1; extra == "develop"
|
|
38
40
|
Provides-Extra: test
|
|
39
|
-
Requires-Dist: pytest<
|
|
41
|
+
Requires-Dist: pytest<10; extra == "test"
|
|
40
42
|
Requires-Dist: pytest-cache<2; extra == "test"
|
|
41
|
-
Requires-Dist: pytest-cov<7.
|
|
42
|
-
Requires-Dist: python-dotenv<1.
|
|
43
|
-
Requires-Dist: responses<0.
|
|
43
|
+
Requires-Dist: pytest-cov<7.2; extra == "test"
|
|
44
|
+
Requires-Dist: python-dotenv<1.3; extra == "test"
|
|
45
|
+
Requires-Dist: responses<0.27; extra == "test"
|
|
44
46
|
Dynamic: author
|
|
45
47
|
Dynamic: author-email
|
|
46
48
|
Dynamic: classifier
|
|
@@ -49,6 +51,7 @@ Dynamic: description-content-type
|
|
|
49
51
|
Dynamic: download-url
|
|
50
52
|
Dynamic: home-page
|
|
51
53
|
Dynamic: keywords
|
|
54
|
+
Dynamic: license
|
|
52
55
|
Dynamic: license-file
|
|
53
56
|
Dynamic: maintainer
|
|
54
57
|
Dynamic: maintainer-email
|
|
@@ -125,9 +128,11 @@ you'll interact with mostly.
|
|
|
125
128
|
|
|
126
129
|
When you issue a request, the response is a [requests.Response][] object. If
|
|
127
130
|
`response.status_code != 200` then a `requests.HTTPError` exception will be
|
|
128
|
-
raised — it's your responsibility to handle those exceptions if you want to.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
raised — it's your responsibility to handle those exceptions if you want to.
|
|
132
|
+
This default can be disabled by passing `raise_for_status=False` when
|
|
133
|
+
constructing the client. The one case that's handled is when the access token
|
|
134
|
+
has expired: in this case, the client will automatically handle the HTTP 400
|
|
135
|
+
status and renew the token.
|
|
131
136
|
|
|
132
137
|
Note that the Client does not attempt to interpret the data supplied by OPS, so
|
|
133
138
|
it's your responsibility to parse the XML or JSON payload for your own purpose.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
epo_ops/__init__.py,sha256=FBeuePcy1kzPa9r8eVbJKuCTH7KraksI9RxpBcOqWXc,571
|
|
2
2
|
epo_ops/__version__.py,sha256=oPE9VFlJQnVOEwuJbON4aK7XhyF3CB86MEnkbhJ0NTU,204
|
|
3
|
-
epo_ops/api.py,sha256=
|
|
3
|
+
epo_ops/api.py,sha256=4GYTZYuD4JkM9LnneEG6vqznuWQAvtPRNb6vga0Nce4,16851
|
|
4
4
|
epo_ops/exceptions.py,sha256=MYaRMNHBH1REggRn0Lmp8_acnHbFb9uq51HFS-qz6c4,620
|
|
5
|
-
epo_ops/models.py,sha256=
|
|
5
|
+
epo_ops/models.py,sha256=dzin5dHJJng0Zv1fFVoFXVDY20ZdAuayQQwFsEgrNPs,3441
|
|
6
6
|
epo_ops/utils.py,sha256=mGy57QUSgpQG21_nbHEj6ZMqoxeAK8TbFwohfGDB6xw,776
|
|
7
7
|
epo_ops/middlewares/__init__.py,sha256=y6MT9llD5jdVduGHUghGr1tgssvoJ75-0L4WlFPe3pw,178
|
|
8
8
|
epo_ops/middlewares/middleware.py,sha256=kXo58_kju4IlM7vTAVwmn2Ynk5O-ZIdoWw2slonT_nY,518
|
|
@@ -16,8 +16,8 @@ epo_ops/middlewares/throttle/utils.py,sha256=DezWXXGJw9GoNk4lPtHVKQ0FZXJo98jgCzv
|
|
|
16
16
|
epo_ops/middlewares/throttle/storages/__init__.py,sha256=VtpaDmfxeQM2-tc9tad5-_DTFYp4n-Ec4QPPi6niglw,81
|
|
17
17
|
epo_ops/middlewares/throttle/storages/sqlite.py,sha256=frYBYpDyay4pTfGrVatqZVsIBATlvGqo-4zZJFddSO4,4934
|
|
18
18
|
epo_ops/middlewares/throttle/storages/storage.py,sha256=FLJ0kvUSDaI_fiHuXbT3UVNRmXcAPS5M2v3vYEYBgQY,757
|
|
19
|
-
python_epo_ops_client-4.2.
|
|
20
|
-
python_epo_ops_client-4.2.
|
|
21
|
-
python_epo_ops_client-4.2.
|
|
22
|
-
python_epo_ops_client-4.2.
|
|
23
|
-
python_epo_ops_client-4.2.
|
|
19
|
+
python_epo_ops_client-4.2.2.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
20
|
+
python_epo_ops_client-4.2.2.dist-info/METADATA,sha256=4v6zbfJDHea4i9KgjR33pkA86g4uP759WyLwQQheONU,10591
|
|
21
|
+
python_epo_ops_client-4.2.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
22
|
+
python_epo_ops_client-4.2.2.dist-info/top_level.txt,sha256=0e54UaEWTAp3B6Xh_hZvJnuTK3iB0xtm57WxsW8xJkI,8
|
|
23
|
+
python_epo_ops_client-4.2.2.dist-info/RECORD,,
|
{python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{python_epo_ops_client-4.2.1.dist-info → python_epo_ops_client-4.2.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|