msgpack-types 0.3.0__tar.gz → 0.5.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.
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/PKG-INFO +4 -3
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/msgpack-stubs/__init__.pyi +30 -24
- msgpack_types-0.5.0/msgpack-stubs/_cmsgpack.pyi +4 -0
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/msgpack-stubs/ext.pyi +9 -12
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/msgpack-stubs/fallback.pyi +19 -17
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/pyproject.toml +5 -4
- msgpack_types-0.3.0/msgpack-stubs/_version.pyi +0 -3
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/LICENSE +0 -0
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/README.md +0 -0
- {msgpack_types-0.3.0 → msgpack_types-0.5.0}/msgpack-stubs/exceptions.pyi +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: msgpack-types
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Type stubs for msgpack
|
|
5
5
|
Home-page: https://github.com/sbdchd/msgpack-types
|
|
6
6
|
License: Apache-2.0
|
|
7
7
|
Keywords: msgpack,types,mypy,stubs
|
|
8
8
|
Author: Steve Dignam
|
|
9
9
|
Author-email: steve@dignam.xyz
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.8,<4.0
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Dist: msgpack (>=1.1.0,<1.2.0)
|
|
19
|
+
Requires-Dist: typing-extensions (>=4.6.0)
|
|
19
20
|
Project-URL: Repository, https://github.com/sbdchd/msgpack-types
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from typing_extensions import Protocol
|
|
7
|
+
|
|
8
|
+
from .exceptions import (
|
|
6
9
|
BufferFull,
|
|
7
10
|
ExtraData,
|
|
8
11
|
FormatError,
|
|
@@ -14,51 +17,57 @@ from msgpack.exceptions import (
|
|
|
14
17
|
UnpackException,
|
|
15
18
|
UnpackValueError,
|
|
16
19
|
)
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
from .ext import ExtType, Timestamp
|
|
21
|
+
from .fallback import Packer, Unpacker, unpackb
|
|
22
|
+
|
|
23
|
+
version: tuple[int, int, int] = ...
|
|
24
|
+
__version__: str = ...
|
|
25
|
+
|
|
26
|
+
class _WriteStream(Protocol):
|
|
27
|
+
def write(self, b: bytes) -> int: ...
|
|
22
28
|
|
|
23
29
|
class _Stream(Protocol):
|
|
24
30
|
def read(self) -> bytes: ...
|
|
25
31
|
|
|
26
32
|
class _FileLike(Protocol):
|
|
27
|
-
def read(n: int) -> bytes: ...
|
|
33
|
+
def read(self, n: int) -> bytes: ...
|
|
28
34
|
|
|
29
35
|
def pack(
|
|
30
36
|
o: Any,
|
|
31
|
-
stream:
|
|
32
|
-
|
|
37
|
+
stream: _WriteStream,
|
|
38
|
+
*,
|
|
39
|
+
default: Callable[[Any], Any] | None = ...,
|
|
33
40
|
use_single_float: bool = ...,
|
|
34
41
|
autoreset: bool = ...,
|
|
35
42
|
use_bin_type: bool = ...,
|
|
36
43
|
strict_types: bool = ...,
|
|
37
44
|
datetime: bool = ...,
|
|
38
|
-
unicode_errors:
|
|
45
|
+
unicode_errors: str | None = ...,
|
|
39
46
|
) -> None: ...
|
|
40
47
|
def packb(
|
|
41
48
|
o: Any,
|
|
42
|
-
|
|
49
|
+
*,
|
|
50
|
+
default: Callable[[Any], Any] | None = ...,
|
|
43
51
|
use_single_float: bool = ...,
|
|
44
52
|
autoreset: bool = ...,
|
|
45
53
|
use_bin_type: bool = ...,
|
|
46
54
|
strict_types: bool = ...,
|
|
47
55
|
datetime: bool = ...,
|
|
48
|
-
unicode_errors:
|
|
56
|
+
unicode_errors: str | None = ...,
|
|
49
57
|
) -> bytes: ...
|
|
50
58
|
def unpack(
|
|
51
59
|
stream: _Stream,
|
|
52
|
-
|
|
60
|
+
*,
|
|
61
|
+
file_like: _FileLike | None = ...,
|
|
53
62
|
read_size: int = ...,
|
|
54
63
|
use_list: bool = ...,
|
|
55
64
|
raw: bool = ...,
|
|
56
65
|
timestamp: int = ...,
|
|
57
66
|
strict_map_key: bool = ...,
|
|
58
|
-
object_hook:
|
|
59
|
-
object_pairs_hook:
|
|
60
|
-
list_hook:
|
|
61
|
-
unicode_errors:
|
|
67
|
+
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
|
|
68
|
+
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
|
|
69
|
+
list_hook: Callable[[list[Any]], Any] | None = ...,
|
|
70
|
+
unicode_errors: str | None = ...,
|
|
62
71
|
max_buffer_size: int = ...,
|
|
63
72
|
ext_hook: Callable[[int, bytes], Any] = ...,
|
|
64
73
|
max_str_len: int = ...,
|
|
@@ -88,12 +97,10 @@ __all__ = [
|
|
|
88
97
|
"Timestamp",
|
|
89
98
|
"UnpackException",
|
|
90
99
|
"UnpackValueError",
|
|
91
|
-
"_version",
|
|
92
100
|
"Unpacker",
|
|
101
|
+
"__version__",
|
|
93
102
|
"dump",
|
|
94
103
|
"dumps",
|
|
95
|
-
"exceptions",
|
|
96
|
-
"ext",
|
|
97
104
|
"load",
|
|
98
105
|
"loads",
|
|
99
106
|
"pack",
|
|
@@ -102,4 +109,3 @@ __all__ = [
|
|
|
102
109
|
"unpackb",
|
|
103
110
|
"version",
|
|
104
111
|
]
|
|
105
|
-
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import datetime
|
|
4
|
+
from typing import NamedTuple
|
|
4
5
|
|
|
5
|
-
class
|
|
6
|
+
class ExtType(NamedTuple):
|
|
6
7
|
code: int
|
|
7
8
|
data: bytes
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
11
|
-
class TimeStamp:
|
|
10
|
+
class Timestamp:
|
|
12
11
|
def __init__(self, seconds: int, nanoseconds: int = ...) -> None: ...
|
|
13
12
|
def __eq__(self, o: object) -> bool: ...
|
|
14
13
|
def __ne__(self, o: object) -> bool: ...
|
|
14
|
+
def __hash__(self) -> int: ...
|
|
15
15
|
@staticmethod
|
|
16
|
-
def from_bytes(b: bytes) ->
|
|
17
|
-
@staticmethod
|
|
16
|
+
def from_bytes(b: bytes) -> Timestamp: ...
|
|
18
17
|
def to_bytes(self) -> bytes: ...
|
|
19
18
|
@staticmethod
|
|
20
|
-
def from_unix(
|
|
19
|
+
def from_unix(unix_sec: float) -> Timestamp: ...
|
|
21
20
|
def to_unix(self) -> float: ...
|
|
22
21
|
@staticmethod
|
|
23
|
-
def from_unix_nano(unix_ns: int) ->
|
|
24
|
-
@staticmethod
|
|
22
|
+
def from_unix_nano(unix_ns: int) -> Timestamp: ...
|
|
25
23
|
def to_unix_nano(self) -> int: ...
|
|
26
24
|
def to_datetime(self) -> datetime.datetime: ...
|
|
27
25
|
@staticmethod
|
|
28
|
-
def from_datetime(dt: datetime.datetime) ->
|
|
29
|
-
|
|
26
|
+
def from_datetime(dt: datetime.datetime) -> Timestamp: ...
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
from typing import Any, Callable, Dict, List, Optional, Tuple
|
|
3
2
|
|
|
4
|
-
from
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from typing_extensions import Protocol, Buffer
|
|
5
7
|
|
|
6
8
|
class _FileLike(Protocol):
|
|
7
|
-
def read(n: int) -> bytes: ...
|
|
9
|
+
def read(self, n: int) -> bytes: ...
|
|
8
10
|
|
|
9
11
|
def unpackb(
|
|
10
|
-
packed:
|
|
11
|
-
file_like:
|
|
12
|
+
packed: Buffer,
|
|
13
|
+
file_like: _FileLike | None = ...,
|
|
12
14
|
read_size: int = ...,
|
|
13
15
|
use_list: bool = ...,
|
|
14
16
|
raw: bool = ...,
|
|
15
17
|
timestamp: int = ...,
|
|
16
18
|
strict_map_key: bool = ...,
|
|
17
|
-
object_hook:
|
|
18
|
-
object_pairs_hook:
|
|
19
|
-
list_hook:
|
|
20
|
-
unicode_errors:
|
|
19
|
+
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
|
|
20
|
+
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
|
|
21
|
+
list_hook: Callable[[list[Any]], Any] | None = ...,
|
|
22
|
+
unicode_errors: str | None = ...,
|
|
21
23
|
max_buffer_size: int = ...,
|
|
22
24
|
ext_hook: Callable[[int, bytes], Any] = ...,
|
|
23
25
|
max_str_len: int = ...,
|
|
@@ -30,16 +32,16 @@ def unpackb(
|
|
|
30
32
|
class Unpacker:
|
|
31
33
|
def __init__(
|
|
32
34
|
self,
|
|
33
|
-
file_like:
|
|
35
|
+
file_like: _FileLike | None = ...,
|
|
34
36
|
read_size: int = ...,
|
|
35
37
|
use_list: bool = ...,
|
|
36
38
|
raw: bool = ...,
|
|
37
39
|
timestamp: int = ...,
|
|
38
40
|
strict_map_key: bool = ...,
|
|
39
|
-
object_hook:
|
|
40
|
-
object_pairs_hook:
|
|
41
|
-
list_hook:
|
|
42
|
-
unicode_errors:
|
|
41
|
+
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
|
|
42
|
+
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
|
|
43
|
+
list_hook: Callable[[list[Any]], Any] | None = ...,
|
|
44
|
+
unicode_errors: str | None = ...,
|
|
43
45
|
max_buffer_size: int = ...,
|
|
44
46
|
ext_hook: Callable[[int, bytes], Any] = ...,
|
|
45
47
|
max_str_len: int = ...,
|
|
@@ -48,7 +50,7 @@ class Unpacker:
|
|
|
48
50
|
max_map_len: int = ...,
|
|
49
51
|
max_ext_len: int = ...,
|
|
50
52
|
): ...
|
|
51
|
-
def feed(self, next_bytes:
|
|
53
|
+
def feed(self, next_bytes: Buffer) -> None: ...
|
|
52
54
|
def read_bytes(self, n: int) -> bytearray: ...
|
|
53
55
|
def __iter__(self) -> Unpacker: ...
|
|
54
56
|
def __next__(self) -> Any: ...
|
|
@@ -62,13 +64,13 @@ class Unpacker:
|
|
|
62
64
|
class Packer:
|
|
63
65
|
def __init__(
|
|
64
66
|
self,
|
|
65
|
-
default:
|
|
67
|
+
default: Callable[[Any], Any] | None = ...,
|
|
66
68
|
use_single_float: bool = ...,
|
|
67
69
|
autoreset: bool = ...,
|
|
68
70
|
use_bin_type: bool = ...,
|
|
69
71
|
strict_types: bool = ...,
|
|
70
72
|
datetime: bool = ...,
|
|
71
|
-
unicode_errors:
|
|
73
|
+
unicode_errors: str | None = ...,
|
|
72
74
|
): ...
|
|
73
75
|
def pack(self, obj: Any) -> bytes: ...
|
|
74
76
|
def pack_map_pairs(self, pairs: Any) -> bytes: ...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "msgpack-types"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.0"
|
|
4
4
|
description = "Type stubs for msgpack"
|
|
5
5
|
repository = "https://github.com/sbdchd/msgpack-types"
|
|
6
6
|
readme = "README.md"
|
|
@@ -13,15 +13,16 @@ packages = [
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
[tool.poetry.dependencies]
|
|
16
|
-
python = "^3.
|
|
16
|
+
python = "^3.8"
|
|
17
|
+
msgpack = ">=1.1.0,<1.2.0"
|
|
18
|
+
typing-extensions = '>=4.6.0'
|
|
17
19
|
|
|
18
20
|
[tool.poetry.dev-dependencies]
|
|
19
21
|
mypy = "^0.790.0"
|
|
20
22
|
ipython = "^7.19"
|
|
21
23
|
flake8 = "^3.8"
|
|
22
|
-
msgpack = "^1.0"
|
|
23
24
|
isort = "^5.6"
|
|
24
|
-
black = {version = "^18.3-alpha.0",
|
|
25
|
+
black = {version = "^18.3-alpha.0",allow-prereleases = true}
|
|
25
26
|
|
|
26
27
|
[build-system]
|
|
27
28
|
requires = ["poetry>=0.12"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|