skip to navigation
skip to content

ltsv 0.0.5

Labeled Tab-separated Values parser

Parser implementation in Python

LTSV:
Labeled Tab-separated Values

Installation

pip install ltsv

Usage

parsing

csv like interface:

>>> import sys
>>> if sys.version_info[0] == 3:
...     from io import StringIO
... else:
...     from cStringIO import StringIO
...
>>> import ltsv
>>> reader = ltsv.reader(StringIO("ip:127.0.0.1\thost:localhost"))
>>> next(reader)
[['ip', '127.0.0.1'], ['host', 'localhost']]

writing

dic = {u'ip': u'127.0.0.1', u'host': u'localhost'}
string = ltsv.writer(dic)
print(string)
# ip:127.0.0.1    host:localhost
 
File Type Py Version Uploaded on Size
ltsv-0.0.5.tar.gz (md5) Source 2013-03-02 2KB