MCPcopy Create free account
hub / github.com/ccxt/ccxt / Unpacker

Class Unpacker

python/ccxt/static_dependencies/msgpack/fallback.py:135–604  ·  view source on GitHub ↗

Streaming unpacker. Arguments: :param file_like: File-like object having `.read(n)` method. If specified, unpacker reads serialized data from it and `.feed()` is not usable. :param int read_size: Used as `file_like.read(read_size)`. (default: `min(16*1024, max_

Source from the content-addressed store, hash-verified

133
134
135class Unpacker:
136 """Streaming unpacker.
137
138 Arguments:
139
140 :param file_like:
141 File-like object having `.read(n)` method.
142 If specified, unpacker reads serialized data from it and `.feed()` is not usable.
143
144 :param int read_size:
145 Used as `file_like.read(read_size)`. (default: `min(16*1024, max_buffer_size)`)
146
147 :param bool use_list:
148 If true, unpack msgpack array to Python list.
149 Otherwise, unpack to Python tuple. (default: True)
150
151 :param bool raw:
152 If true, unpack msgpack raw to Python bytes.
153 Otherwise, unpack to Python str by decoding with UTF-8 encoding (default).
154
155 :param int timestamp:
156 Control how timestamp type is unpacked:
157
158 0 - Timestamp
159 1 - float (Seconds from the EPOCH)
160 2 - int (Nanoseconds from the EPOCH)
161 3 - datetime.datetime (UTC).
162
163 :param bool strict_map_key:
164 If true (default), only str or bytes are accepted for map (dict) keys.
165
166 :param object_hook:
167 When specified, it should be callable.
168 Unpacker calls it with a dict argument after unpacking msgpack map.
169 (See also simplejson)
170
171 :param object_pairs_hook:
172 When specified, it should be callable.
173 Unpacker calls it with a list of key-value pairs after unpacking msgpack map.
174 (See also simplejson)
175
176 :param str unicode_errors:
177 The error handler for decoding unicode. (default: 'strict')
178 This option should be used only when you have msgpack data which
179 contains invalid UTF-8 string.
180
181 :param int max_buffer_size:
182 Limits size of data waiting unpacked. 0 means 2**32-1.
183 The default value is 100*1024*1024 (100MiB).
184 Raises `BufferFull` exception when it is insufficient.
185 You should set this parameter when unpacking data from untrusted source.
186
187 :param int max_str_len:
188 Deprecated, use *max_buffer_size* instead.
189 Limits max length of str. (default: max_buffer_size)
190
191 :param int max_bin_len:
192 Deprecated, use *max_buffer_size* instead.

Callers 1

unpackbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…