Created
July 14, 2018 13:43
-
-
Save anthonytxie/9b50c1a0d29808082af604469cbbefc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from blockchain import blockexplorer\n", | |
"import pandas as pd\n", | |
"import time\n", | |
"import datetime\n", | |
"import csv \n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"tx_history = {'date': [], 'total_input_value':[]}\n", | |
"\n", | |
"for num in range(1,10000):\n", | |
" time.sleep(1)\n", | |
" print(str(num) + 'request')\n", | |
" address = blockexplorer.get_address('1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s', limit=(num*50), offset=((num-1)*50))\n", | |
" for transaction in address.transactions:\n", | |
" total_output_value = 0\n", | |
" for n in transaction.outputs:\n", | |
" total_output_value+=n.value\n", | |
" with open(r'/Users/anthony/desktop/binance_transactions.csv', 'a') as f:\n", | |
" writer = csv.writer(f)\n", | |
" writer.writerow([transaction.time, total_output_value/100000000, transaction.hash])\n" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.4" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment