jsonrpc-base 2.1.1__tar.gz → 2.3.0__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.
- {jsonrpc-base-2.1.1/jsonrpc_base.egg-info → jsonrpc_base-2.3.0}/PKG-INFO +29 -13
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/README.rst +12 -4
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/jsonrpc_base/jsonrpc.py +21 -4
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0/jsonrpc_base.egg-info}/PKG-INFO +29 -13
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/setup.py +7 -5
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/LICENSE.txt +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/MANIFEST.in +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/jsonrpc_base/__init__.py +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/jsonrpc_base.egg-info/SOURCES.txt +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/jsonrpc_base.egg-info/dependency_links.txt +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/jsonrpc_base.egg-info/top_level.txt +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/requirements-test.txt +0 -0
- {jsonrpc-base-2.1.1 → jsonrpc_base-2.3.0}/setup.cfg +0 -0
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonrpc-base
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: A JSON-RPC client library base interface
|
|
5
5
|
Home-page: http://github.com/emlove/jsonrpc-base
|
|
6
|
-
Author: Emily Love
|
|
6
|
+
Author: Emily Love Watson
|
|
7
7
|
Author-email: emily@emlove.me
|
|
8
8
|
License: BSD
|
|
9
9
|
Keywords: json-rpc base
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Topic :: Software Development :: Libraries
|
|
14
13
|
Classifier: License :: OSI Approved :: BSD License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
21
|
License-File: LICENSE.txt
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: keywords
|
|
28
|
+
Dynamic: license
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: summary
|
|
21
31
|
|
|
22
32
|
jsonrpc-base: a compact JSON-RPC client library interface supporting multiple backends
|
|
23
33
|
=======================================================================================================
|
|
24
34
|
|
|
25
|
-
.. image:: https://
|
|
26
|
-
:target: https://
|
|
35
|
+
.. image:: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml/badge.svg
|
|
36
|
+
:target: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml
|
|
27
37
|
.. image:: https://coveralls.io/repos/emlove/jsonrpc-base/badge.svg
|
|
28
38
|
:target: https://coveralls.io/r/emlove/jsonrpc-base
|
|
29
39
|
|
|
@@ -32,7 +42,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
|
|
|
32
42
|
Main Features
|
|
33
43
|
-------------
|
|
34
44
|
|
|
35
|
-
* Python 3.6, 3.7, 3.8 & 3.9 compatible
|
|
36
45
|
* Supports nested namespaces (eg. `app.users.getUsers()`)
|
|
37
46
|
* 100% test coverage
|
|
38
47
|
|
|
@@ -47,6 +56,15 @@ Install the Python tox package and run ``tox``, it'll test this package with var
|
|
|
47
56
|
|
|
48
57
|
Changelog
|
|
49
58
|
---------
|
|
59
|
+
2.3.0 (2026-11-30)
|
|
60
|
+
~~~~~~~~~~~~~~~~~~
|
|
61
|
+
- Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
|
|
62
|
+
- Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
|
|
63
|
+
|
|
64
|
+
2.2.0 (2023-12-11)
|
|
65
|
+
~~~~~~~~~~~~~~~~~~
|
|
66
|
+
- Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
|
|
67
|
+
|
|
50
68
|
2.1.1 (2022-05-03)
|
|
51
69
|
~~~~~~~~~~~~~~~~~~
|
|
52
70
|
- Unpin test dependencies
|
|
@@ -66,7 +84,7 @@ Changelog
|
|
|
66
84
|
|
|
67
85
|
1.0.3 (2019-11-12)
|
|
68
86
|
~~~~~~~~~~~~~~~~~~
|
|
69
|
-
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@
|
|
87
|
+
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@a1fred <https://github.com/a1fred>`_
|
|
70
88
|
|
|
71
89
|
1.0.2 (2018-08-23)
|
|
72
90
|
~~~~~~~~~~~~~~~~~~
|
|
@@ -84,5 +102,3 @@ Credits
|
|
|
84
102
|
compliance and other improvements.
|
|
85
103
|
|
|
86
104
|
`@vaab <https://github.com/vaab>`_ for providing api and tests improvements, better RFC compliance.
|
|
87
|
-
|
|
88
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
jsonrpc-base: a compact JSON-RPC client library interface supporting multiple backends
|
|
2
2
|
=======================================================================================================
|
|
3
3
|
|
|
4
|
-
.. image:: https://
|
|
5
|
-
:target: https://
|
|
4
|
+
.. image:: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml/badge.svg
|
|
5
|
+
:target: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml
|
|
6
6
|
.. image:: https://coveralls.io/repos/emlove/jsonrpc-base/badge.svg
|
|
7
7
|
:target: https://coveralls.io/r/emlove/jsonrpc-base
|
|
8
8
|
|
|
@@ -11,7 +11,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
|
|
|
11
11
|
Main Features
|
|
12
12
|
-------------
|
|
13
13
|
|
|
14
|
-
* Python 3.6, 3.7, 3.8 & 3.9 compatible
|
|
15
14
|
* Supports nested namespaces (eg. `app.users.getUsers()`)
|
|
16
15
|
* 100% test coverage
|
|
17
16
|
|
|
@@ -26,6 +25,15 @@ Install the Python tox package and run ``tox``, it'll test this package with var
|
|
|
26
25
|
|
|
27
26
|
Changelog
|
|
28
27
|
---------
|
|
28
|
+
2.3.0 (2026-11-30)
|
|
29
|
+
~~~~~~~~~~~~~~~~~~
|
|
30
|
+
- Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
|
|
31
|
+
- Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
|
|
32
|
+
|
|
33
|
+
2.2.0 (2023-12-11)
|
|
34
|
+
~~~~~~~~~~~~~~~~~~
|
|
35
|
+
- Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
|
|
36
|
+
|
|
29
37
|
2.1.1 (2022-05-03)
|
|
30
38
|
~~~~~~~~~~~~~~~~~~
|
|
31
39
|
- Unpin test dependencies
|
|
@@ -45,7 +53,7 @@ Changelog
|
|
|
45
53
|
|
|
46
54
|
1.0.3 (2019-11-12)
|
|
47
55
|
~~~~~~~~~~~~~~~~~~
|
|
48
|
-
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@
|
|
56
|
+
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@a1fred <https://github.com/a1fred>`_
|
|
49
57
|
|
|
50
58
|
1.0.2 (2018-08-23)
|
|
51
59
|
~~~~~~~~~~~~~~~~~~
|
|
@@ -10,6 +10,15 @@ class JSONRPCError(Exception):
|
|
|
10
10
|
"""Root exception for all errors related to this library"""
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
def _argument_text(argument):
|
|
14
|
+
"""Return the str() of an argument, or its type if empty or failing."""
|
|
15
|
+
try:
|
|
16
|
+
text = str(argument)
|
|
17
|
+
except Exception:
|
|
18
|
+
text = ''
|
|
19
|
+
return text or type(argument).__name__
|
|
20
|
+
|
|
21
|
+
|
|
13
22
|
class TransportError(JSONRPCError):
|
|
14
23
|
"""An error occurred while performing a connection to the server"""
|
|
15
24
|
|
|
@@ -22,6 +31,12 @@ class TransportError(JSONRPCError):
|
|
|
22
31
|
else:
|
|
23
32
|
super(TransportError, self).__init__(exception_text, *args)
|
|
24
33
|
|
|
34
|
+
def __str__(self):
|
|
35
|
+
"""Join the str() of each argument when there is more than one."""
|
|
36
|
+
if len(self.args) < 2:
|
|
37
|
+
return super(TransportError, self).__str__()
|
|
38
|
+
return ': '.join(_argument_text(arg) for arg in self.args)
|
|
39
|
+
|
|
25
40
|
|
|
26
41
|
class ProtocolError(JSONRPCError):
|
|
27
42
|
"""An error occurred while dealing with the JSON-RPC protocol"""
|
|
@@ -193,7 +208,7 @@ class Request(Message):
|
|
|
193
208
|
def serialize(self):
|
|
194
209
|
"""Generate the raw JSON message to be sent to the server"""
|
|
195
210
|
data = {'jsonrpc': '2.0', 'method': self.method}
|
|
196
|
-
if self.params
|
|
211
|
+
if self.params:
|
|
197
212
|
data['params'] = self.params
|
|
198
213
|
if self.msg_id is not None:
|
|
199
214
|
data['id'] = self.msg_id
|
|
@@ -208,9 +223,11 @@ class Request(Message):
|
|
|
208
223
|
if not isinstance(data, dict):
|
|
209
224
|
raise ProtocolError('Response is not a dictionary')
|
|
210
225
|
if data.get('error') is not None:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
226
|
+
get = getattr(data['error'], 'get', None)
|
|
227
|
+
if not callable(get):
|
|
228
|
+
raise ProtocolError(
|
|
229
|
+
'', 'Response error is not an object', data)
|
|
230
|
+
raise ProtocolError(get('code', ''), get('message', ''), data)
|
|
214
231
|
elif 'result' not in data:
|
|
215
232
|
raise ProtocolError('Response without a result field')
|
|
216
233
|
else:
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonrpc-base
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: A JSON-RPC client library base interface
|
|
5
5
|
Home-page: http://github.com/emlove/jsonrpc-base
|
|
6
|
-
Author: Emily Love
|
|
6
|
+
Author: Emily Love Watson
|
|
7
7
|
Author-email: emily@emlove.me
|
|
8
8
|
License: BSD
|
|
9
9
|
Keywords: json-rpc base
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Topic :: Software Development :: Libraries
|
|
14
13
|
Classifier: License :: OSI Approved :: BSD License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
21
|
License-File: LICENSE.txt
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: keywords
|
|
28
|
+
Dynamic: license
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: summary
|
|
21
31
|
|
|
22
32
|
jsonrpc-base: a compact JSON-RPC client library interface supporting multiple backends
|
|
23
33
|
=======================================================================================================
|
|
24
34
|
|
|
25
|
-
.. image:: https://
|
|
26
|
-
:target: https://
|
|
35
|
+
.. image:: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml/badge.svg
|
|
36
|
+
:target: https://github.com/emlove/jsonrpc-base/actions/workflows/main.yml
|
|
27
37
|
.. image:: https://coveralls.io/repos/emlove/jsonrpc-base/badge.svg
|
|
28
38
|
:target: https://coveralls.io/r/emlove/jsonrpc-base
|
|
29
39
|
|
|
@@ -32,7 +42,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
|
|
|
32
42
|
Main Features
|
|
33
43
|
-------------
|
|
34
44
|
|
|
35
|
-
* Python 3.6, 3.7, 3.8 & 3.9 compatible
|
|
36
45
|
* Supports nested namespaces (eg. `app.users.getUsers()`)
|
|
37
46
|
* 100% test coverage
|
|
38
47
|
|
|
@@ -47,6 +56,15 @@ Install the Python tox package and run ``tox``, it'll test this package with var
|
|
|
47
56
|
|
|
48
57
|
Changelog
|
|
49
58
|
---------
|
|
59
|
+
2.3.0 (2026-11-30)
|
|
60
|
+
~~~~~~~~~~~~~~~~~~
|
|
61
|
+
- Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
|
|
62
|
+
- Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
|
|
63
|
+
|
|
64
|
+
2.2.0 (2023-12-11)
|
|
65
|
+
~~~~~~~~~~~~~~~~~~
|
|
66
|
+
- Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
|
|
67
|
+
|
|
50
68
|
2.1.1 (2022-05-03)
|
|
51
69
|
~~~~~~~~~~~~~~~~~~
|
|
52
70
|
- Unpin test dependencies
|
|
@@ -66,7 +84,7 @@ Changelog
|
|
|
66
84
|
|
|
67
85
|
1.0.3 (2019-11-12)
|
|
68
86
|
~~~~~~~~~~~~~~~~~~
|
|
69
|
-
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@
|
|
87
|
+
- Forwards compatibility for Python 3.9. `(#4) <https://github.com/emlove/jsonrpc-base/pull/4>`_ `@a1fred <https://github.com/a1fred>`_
|
|
70
88
|
|
|
71
89
|
1.0.2 (2018-08-23)
|
|
72
90
|
~~~~~~~~~~~~~~~~~~
|
|
@@ -84,5 +102,3 @@ Credits
|
|
|
84
102
|
compliance and other improvements.
|
|
85
103
|
|
|
86
104
|
`@vaab <https://github.com/vaab>`_ for providing api and tests improvements, better RFC compliance.
|
|
87
|
-
|
|
88
|
-
|
|
@@ -9,8 +9,8 @@ except ImportError:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name='jsonrpc-base',
|
|
12
|
-
version='2.
|
|
13
|
-
author='Emily Love
|
|
12
|
+
version='2.3.0',
|
|
13
|
+
author='Emily Love Watson',
|
|
14
14
|
author_email='emily@emlove.me',
|
|
15
15
|
packages=('jsonrpc_base',),
|
|
16
16
|
license='BSD',
|
|
@@ -25,10 +25,12 @@ setup(
|
|
|
25
25
|
'Topic :: Software Development :: Libraries',
|
|
26
26
|
'License :: OSI Approved :: BSD License',
|
|
27
27
|
'Programming Language :: Python :: 3',
|
|
28
|
-
'Programming Language :: Python :: 3.7',
|
|
29
|
-
'Programming Language :: Python :: 3.8',
|
|
30
|
-
'Programming Language :: Python :: 3.9',
|
|
31
28
|
'Programming Language :: Python :: 3.10',
|
|
29
|
+
'Programming Language :: Python :: 3.11',
|
|
30
|
+
'Programming Language :: Python :: 3.12',
|
|
31
|
+
'Programming Language :: Python :: 3.13',
|
|
32
|
+
'Programming Language :: Python :: 3.14',
|
|
33
|
+
'Programming Language :: Python :: 3.15',
|
|
32
34
|
],
|
|
33
35
|
|
|
34
36
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|