Skip to content

Commit 98671ee

Browse files
committed
ENH: support for msgpack serialization/deserialization
DOC: install.rst mention DOC: added license from msgpack_numpy PERF: changed Timestamp and DatetimeIndex serialization for speedups add vb_suite benchmarks ENH: added to_msgpack method in generic.py, and default import into pandas TST: all packers to always be imported, fail on usage with no msgpack installed
1 parent cc282d8 commit 98671ee

File tree

9 files changed

+811
-1
lines changed

9 files changed

+811
-1
lines changed

LICENSES/MSGPACK_NUMPY_LICENSE

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. -*- rst -*-
2+
3+
License
4+
=======
5+
6+
Copyright (c) 2013, Lev Givon.
7+
All rights reserved.
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are
11+
met:
12+
13+
* Redistributions of source code must retain the above copyright
14+
notice, this list of conditions and the following disclaimer.
15+
* Redistributions in binary form must reproduce the above
16+
copyright notice, this list of conditions and the following
17+
disclaimer in the documentation and/or other materials provided
18+
with the distribution.
19+
* Neither the name of Lev Givon nor the names of any
20+
contributors may be used to endorse or promote products derived
21+
from this software without specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

doc/source/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Optional Dependencies
9393
version. Version 0.17.1 or higher.
9494
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions
9595
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage
96+
* `msgpack <http://www.msgpack.org>`__: necessary for msgpack based serialization
9697
* `matplotlib <http://matplotlib.sourceforge.net/>`__: for plotting
9798
* `statsmodels <http://statsmodels.sourceforge.net/>`__
9899
* Needed for parts of :mod:`pandas.stats`

pandas/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from pandas.io.parsers import (read_csv, read_table, read_clipboard,
3333
read_fwf, to_clipboard, ExcelFile,
3434
ExcelWriter)
35+
from pandas.io.packers import read_msgpack, to_msgpack
3536
from pandas.io.pytables import HDFStore, Term, get_store, read_hdf
3637
from pandas.io.html import read_html
3738
from pandas.util.testing import debug

pandas/core/generic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ def to_hdf(self, path_or_buf, key, **kwargs):
487487
from pandas.io import pytables
488488
return pytables.to_hdf(path_or_buf, key, self, **kwargs)
489489

490+
def to_msgpack(self, path_or_buf, **kwargs):
491+
from pandas.io import packers
492+
return packers.to_msgpack(path_or_buf, self, **kwargs)
493+
490494
# install the indexerse
491495
for _name, _indexer in indexing.get_indexers_list():
492496
PandasObject._create_indexer(_name,_indexer)

pandas/core/internals.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from pandas.tslib import Timestamp
1616
from pandas.util import py3compat
1717

18-
1918
class Block(object):
2019
"""
2120
Canonical n-dimensional unit of homogeneous dtype contained in a pandas

0 commit comments

Comments
 (0)