Python msgpack module: packb and newlines

Spaceman

Currently we are using json to code\decode data in our data processing software. But we found any JSON implementation slow - we tried simplejson, ujson etc. - so we're looking for an alternative.

We use some other programs to work with data, and newline symbol is a terminator for each piece of data. In other words, we'd like to avoid serializators that might put newline symbol into dumped objects.

I tried msgpack on a small piece of data, and it seems it does not put newline symbol (pickle does). And it's quite fast.

Could anybody tell me if newlines will not be used in any dumped object, if I use msgpack packb() method? Thanks

jsumali

Yes, msgpack does add newlines (unfortunately):

>>> import msgpack
>>> s = msgpack.packb({"a":10,"b":13})
>>> s
'\x82\xa1a\n\xa1b\r'
>>> '\r' in s
True
>>> '\n' in s
True

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

msgpack: haskell & python

From Dev

How do I decode a msgpack file in Python?

From Dev

Using msgpack-python with nested namedtuples

From Dev

Python: Configparser - escape newlines?

From Dev

How to omit newlines in Python?

From Dev

MsgPack packing of string values longer than 32 characters in python

From Dev

How do you use msgpack to replace copy.deepcopy in Python?

From Dev

Unexpected newlines being printed in Python

From Dev

Python Regex Excluding Multiple Newlines

From Dev

Python Regex Excluding Multiple Newlines

From Dev

Python regex over multiple newlines

From Dev

Remove whitespace and newlines - beautifulsoup python

From Dev

Add missing periods to newlines in Python

From Dev

How to use python -c "code here" with newlines?

From Dev

Python Regular Expression - Matching Newlines with Numerous Matches

From Dev

Python Django send_mail newlines?

From Dev

Bokeh HoverTool custom font and newlines from Python

From Dev

Python modifies newlines when writing a file

From Dev

Python: flatten an XML document (remove newlines)

From Dev

Python write valid json with newlines to file

From Dev

Python splitting text file keeping newlines

From Dev

Most efficient way to delete needless newlines in Python

From Dev

super simple python program - substituting whitespaces with newlines?

From Dev

Python regex erronously matches trailing newlines

From Dev

Python: flatten an XML document (remove newlines)

From Dev

Removing whitespace and newlines in txt file with python

From Dev

finding a pattern, adding newlines after it in python 2.7

From Dev

Replace newlines with a space in all files in a directory - Python

From Dev

Opening A large JSON file in Python with no newlines for csv conversion Python 2.6.6

Related Related

  1. 1

    msgpack: haskell & python

  2. 2

    How do I decode a msgpack file in Python?

  3. 3

    Using msgpack-python with nested namedtuples

  4. 4

    Python: Configparser - escape newlines?

  5. 5

    How to omit newlines in Python?

  6. 6

    MsgPack packing of string values longer than 32 characters in python

  7. 7

    How do you use msgpack to replace copy.deepcopy in Python?

  8. 8

    Unexpected newlines being printed in Python

  9. 9

    Python Regex Excluding Multiple Newlines

  10. 10

    Python Regex Excluding Multiple Newlines

  11. 11

    Python regex over multiple newlines

  12. 12

    Remove whitespace and newlines - beautifulsoup python

  13. 13

    Add missing periods to newlines in Python

  14. 14

    How to use python -c "code here" with newlines?

  15. 15

    Python Regular Expression - Matching Newlines with Numerous Matches

  16. 16

    Python Django send_mail newlines?

  17. 17

    Bokeh HoverTool custom font and newlines from Python

  18. 18

    Python modifies newlines when writing a file

  19. 19

    Python: flatten an XML document (remove newlines)

  20. 20

    Python write valid json with newlines to file

  21. 21

    Python splitting text file keeping newlines

  22. 22

    Most efficient way to delete needless newlines in Python

  23. 23

    super simple python program - substituting whitespaces with newlines?

  24. 24

    Python regex erronously matches trailing newlines

  25. 25

    Python: flatten an XML document (remove newlines)

  26. 26

    Removing whitespace and newlines in txt file with python

  27. 27

    finding a pattern, adding newlines after it in python 2.7

  28. 28

    Replace newlines with a space in all files in a directory - Python

  29. 29

    Opening A large JSON file in Python with no newlines for csv conversion Python 2.6.6

HotTag

Archive