Skip to content

Instantly share code, notes, and snippets.

@otomazeli
otomazeli / client.nut
Created September 11, 2017 15:51 — forked from dt/client.nut
Coffee Monitor Imp
light <- hardware.pin8;
light.configure(ANALOG_IN);
was_brewing <- false;
brew_light <- 45000;
poll_time <- 30;
skip_updates <- 10;
until_heartbeat <- 0;
@otomazeli
otomazeli / gtranslate.py
Created October 31, 2017 14:13 — forked from mouuff/gtranslate.py
android fast translator
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import android
import urllib2
droid = android.Android()
def translate(to_translate, to_langage="auto", langage="auto"):
'''Return the translation using google translate
import os
import sys
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import time
import asyncio
from fake_useragent import UserAgent
'''set path variables'''
project_dir = "YOUR/PROJECT/DIR"
import pandas as pd
import numpy as np
import re
# ================================================
class option_parser:
def __init__(self, symbol, response):
self.symbol = symbol
self.response = response
# ------------------------------------------------
import asyncio
import aiohttp
# ================================================
# for first run only
class first_async_scraper:
def __init__(self):
pass
async def _fetch(self, symbol, url, session, headers):
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 2 13:26:48 2016
@author: Brian Christopher, CFA [Blackarbs LLC]
"""
import time
import pandas as pd
import numpy as np
@otomazeli
otomazeli / Free_Intraday_StockData_Test_BarChart_API_Gist.py
Created February 6, 2018 14:40 — forked from BlackArbsCEO/Free_Intraday_StockData_Test_BarChart_API_Gist.py
Example code from 'Get Free Intraday Stock Data With Python and BarChart OnDemand API' blog post.
# -*- coding: utf-8 -*-
import time
t0 = time.clock()
import pandas as pd
from pandas.tseries.offsets import BDay
import numpy as np
import datetime as dt
from copy import copy
@otomazeli
otomazeli / BlackArbs_ETF_Macro Valuation_SPDR_4112015
Created February 6, 2018 14:40 — forked from BlackArbsCEO/BlackArbs_ETF_Macro Valuation_SPDR_4112015
BlackArbs Macro Valuation tool_ Implied Cost of Capital, risk, return
{"metadata": {"language_info": {"mimetype": "text/x-python", "codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "name": "python", "pygments_lexer": "ipython3", "version": "3.4.3", "nbconvert_exporter": "python"}, "kernelspec": {"name": "python3", "language": "python", "display_name": "Python 3"}}, "cells": [{"source": "###**BlackArbs LLC Independent Research**", "cell_type": "markdown", "metadata": {}}, {"source": "\n####SPDR ETF Composite Sector Valuation [Saturday 4.11.2015]\n------------\n\nThe following Ipython Notebook examines the **Implied Cost of Capital (ICC)** method of valuation for purposes of trade/portfolio positioning. The goal is to identify asymmetric investing opportunities due to incongruence between *'recent'* historical valuations and forward looking expectations of earnings growth. \n\nI will attempt to accomplish the goal by first examining composite returns based on ETF category groupings. Then I will compare the historical data vs the forward looking **ICC*
@otomazeli
otomazeli / NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Created February 6, 2018 14:40 — forked from BlackArbsCEO/NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Simple Linear Regression comparing NFL Quarterback Win Percentage vs. Touchdown to Interception ratio using data collected from Pro-football-reference.com
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'''
Netfonds import 5 days of intraday data
'''
import numpy as np
import pandas as p
from pandas.tseries.offsets import *
import datetime as dt
import matplotlib.pyplot as plt
size = (14,10)