Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2012 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2878563 to your computer and use it in GitHub Desktop.
Save anonymous/2878563 to your computer and use it in GitHub Desktop.
rg JSON -> human
#!/usr/bin/env python
import csv
import json
import sys
import time
def main():
L = json.load(sys.stdin)
for i in L:
print 'Date: ', time.strftime('%d %b %Y', time.gmtime(i['time'])), ',',
print 'Amount: ', i['amount'], ',',
if 'fee' in i:
print 'Fee: ', i['fee'], ',',
print 'Sent to: ', i['address'],
print
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment