mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-06-19 22:28:17 +02:00
acknowledgment
This commit is contained in:
1 parent
7571139f79
commit
4f552e370e
1 file changed
+3
-1
+3
-1
@@ -14,8 +14,10 @@ Examples:
|
||||
|
||||
def parse(data):
|
||||
|
||||
cleandata = data.splitlines()
|
||||
# code adapted from Conor Heine at:
|
||||
# https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501
|
||||
|
||||
cleandata = data.splitlines()
|
||||
headers = [h for h in ' '.join(cleandata[0].strip().split()).split() if h]
|
||||
raw_data = map(lambda s: s.strip().split(None, len(headers) - 1), cleandata[1:])
|
||||
return [dict(zip(headers, r)) for r in raw_data]
|
||||
Reference in new issue
Block a user