Skip to content

Instantly share code, notes, and snippets.

@hesamaseh
hesamaseh / stock.py
Created May 25, 2019 17:06
Yahoo finance data
import pandas_datareader as pdr
from datetime import datetime
from pandas import DataFrame as df
def get_data(selection, sdate, edate):
data = pdr.get_data_yahoo(symbols=selection, start=sdate, end=edate)
data = df(data['Adj Close'])
return data
start_date = datetime(2017, 1, 1)
@hesamaseh
hesamaseh / client.py
Created January 3, 2018 11:55 — forked from yoavram/client.py
Example of uploading binary files programmatically in python, including both client and server code. Client implemented with the requests library and the server is implemented with the flask library.
import requests
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print r.text
@hesamaseh
hesamaseh / install_python.ps1
Created October 27, 2016 02:15 — forked from carlosfunk/install_python.ps1
Powershell scripts for setting up a Python environment under Windows
# To run this file you will need to open Powershell as administrator and first run:
# Set-ExecutionPolicy Unrestricted
# Then source this script by running:
# . .\install_python.ps1
$save_dir=Resolve-Path ~/Downloads
$project_dir = "C:\Projects"
$virtualenv_dir = $project_dir + "\virtualenvs"
$client = New-Object System.Net.WebClient