lz-string for python 2/3
Based on the LZ-String javascript found here: http://pieroxy.net/blog/pages/lz-string/index.html
>>> import lzstring >>> x = lzstring.LZString() >>> compressed = x.compressToBase64(u'你好') # 'gbyl9NIA' >>> x.decompressFromBase64(compressed) # '你好'
$ pip install lzstring