10000 Update README · pyway/msgpack-python@7991530 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7991530

Browse files
committed
Update README
1 parent f4cb6fb commit 7991530

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

README.rst

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
===========================
2-
MessagePack Python Binding
3-
===========================
1+
=======================
2+
MessagePack for Python
3+
=======================
44

55
:author: INADA Naoki
66
:version: 0.3.0
@@ -9,30 +9,53 @@ MessagePack Python Binding
99
.. image:: https://secure.travis-ci.org/msgpack/msgpack-python.png
1010
:target: https://travis-ci.org/#!/msgpack/msgpack-python
1111

12-
WHAT IT IS
13-
----------
12+
What's this
13+
------------
1414

1515
`MessagePack <http://msgpack.org/>`_ is a fast, compact binary serialization format, suitable for
1616
similar data to JSON. This package provides CPython bindings for reading and
1717
writing MessagePack data.
1818

19-
NOTE for msgpack 0.2.x users
19+
Install
20+
---------
21+
You can use ``pip`` or ``easy_install`` to install msgpack::
22+
23+
$ easy_install msgpack-python
24+
or
25+
$ pip install msgpack-python
26+
27+
PyPy
28+
^^^^^
29+
30+
msgpack-python provides pure python implementation.
31+
PyPy can use this.
32+
33+
Windows
34+
^^^^^^^
35+
36+
When you can't use binary distribution, you need to install Visual Studio
37+
or Windows SDK on Windows. (NOTE: Visual C++ Express 2010 doesn't support
38+
amd64. Windows SDK is recommanded way to build amd64 msgpack without any fee.)
39+
40+
Without extension, using pure python implementation on CPython runs slowly.
41+
42+
Note for msgpack 0.2.x users
2043
----------------------------
2144

2245
The msgpack 0.3 have some incompatible changes.
2346

24-
The default value of ``use_list`` keyword argument is ``True`` from 0.3.x.
47+
The default value of ``use_list`` keyword argument is ``True`` from 0.3.
2548
You should pass the argument explicitly for backward compatibility.
2649

2750
`Unpacker.unpack()` and some unpack methods now raises `OutOfData`
2851
instead of `StopIteration`.
2952
`StopIteration` is used for iterator protocol only.
3053

3154

32-
HOW TO USE
55+
How to use
3356
-----------
3457

35-
one-shot pack & unpack
58+
One-shot pack & unpack
3659
^^^^^^^^^^^^^^^^^^^^^^
3760

3861
Use ``packb`` for packing and ``unpackb`` for unpacking.
@@ -60,7 +83,7 @@ You should always pass the ``use_list`` keyword argument. See performance issues
6083
Read the docstring for other options.
6184

6285

63-
streaming unpacking
86+
Streaming unpacking
6487
^^^^^^^^^^^^^^^^^^^
6588

6689
``Unpacker`` is a "streaming unpacker". It unpacks multiple objects from one
@@ -82,7 +105,7 @@ stream (or from bytes provided through its ``feed`` method).
82105
print unpacked
83106

84107

85-
packing/unpacking of custom data type
108+
Packing/unpacking of custom data type
86109
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87110

88111
It is also possible to pack/unpack custom data types. Here is an example for
@@ -118,7 +141,7 @@ It is also possible to pack/unpack custom data types. Here is an example for
118141
key-value pairs.
119142

120143

121-
advanced unpacking control
144+
Advanced unpacking control
122145
^^^^^^^^^^^^^^^^^^^^^^^^^^
123146

124147
As an alternative to iteration, ``Unpacker`` objects provide ``unpack``,
@@ -150,27 +173,8 @@ callback function:
150173
unpacker.skip(bytestream.write)
151174
worker.send(bytestream.getvalue())
152175

153-
INSTALL
154-
---------
155-
You can use ``pip`` or ``easy_install`` to install msgpack::
156-
157-
$ easy_install msgpack-python
158-
or
159-
$ pip install msgpack-python
160-
161-
162-
Windows
163-
^^^^^^^
164-
msgpack provides some binary distribution for Windows.
165-
You can install msgpack without compiler with them.
166-
167-
When you can't use binary distribution, you need to install Visual Studio
168-
or Windows SDK on Windows. (NOTE: Visual C++ Express 2010 doesn't support
169-
amd64. Windows SDK is recommanded way to build amd64 msgpack without any fee.)
170-
171-
172-
PERFORMANCE NOTE
173-
-----------------
176+
Note about performance
177+
------------------------
174178

175179
GC
176180
^^
@@ -179,8 +183,8 @@ CPython's GC starts when growing allocated object.
179183
This means unpacking may cause useless GC.
180184
You can use ``gc.disable()`` when unpacking large message.
181185

182-
use_list
183-
^^^^^^^^^
186+
`use_list` option
187+
^^^^^^^^^^^^^^^^^^
184188
List is the default sequence type of Python.
185189
But tuple is lighter than list.
186190
You can use ``use_list=False`` while unpacking when performance is important.
@@ -190,13 +194,12 @@ Python's dict can't use list as key and MessagePack allows array for key of mapp
190194
Another way to unpacking such object is using ``object_pairs_hook``.
191195

192196

193-
TEST
197+
Test
194198
----
195199
MessagePack uses `pytest` for testing.
196200
Run test with following command:
197201

198202
$ py.test
199203

200-
201204
..
202205
vim: filetype=rst

0 commit comments

Comments
 (0)
0