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.

Filename, size & hash SHA256 hash help File type Python version Upload date
ltsv-0.0.5.tar.gz (2.1 kB) Copy SHA256 hash SHA256 Source None Mar 2, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page