Skip to main content

Labeled Tab-separated Values parser

Project description

https://travis-ci.org/hekyou/python-ltsv.png?branch=master

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ltsv-0.0.5.tar.gz (2.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page