diff textshaper/tablify.py @ 37:8cf9a26b9aaa

STUB: textshaper/main.py textshaper/tablify.py
author Jeff Hammel <k0scist@gmail.com>
date Mon, 12 May 2014 10:29:06 -0700
parents 5ffa0dbcb7fe
children
line wrap: on
line diff
--- a/textshaper/tablify.py	Sat May 03 14:47:16 2014 -0700
+++ b/textshaper/tablify.py	Mon May 12 10:29:06 2014 -0700
@@ -1,3 +1,16 @@
+"""
+functions having to do with tables
+"""
+
+import csv
+from .decorator import lines
+from StringIO import StringIO
+
+@lines
+def make_csv(text):
+    """make space-separated text into comma-separated"""
+    return [','.join(line.strip().split()) for line in text]
+
 def format_cols(rows, header=None, right_align=()):
     if header:
         raise NotImplementedError('TODO') # -> record TODO items