Skip to content

Instantly share code, notes, and snippets.

@davidlenz
davidlenz / binance_get_historical_klines.py
Created April 24, 2018 19:15 — forked from sammchardy/binance_get_historical_klines.py
Get historical Klines from Binance
# uses the date_to_milliseconds and interval_to_milliseconds functions
# https://gist.github.com/sammchardy/3547cfab1faf78e385b3fcb83ad86395
# https://gist.github.com/sammchardy/fcbb2b836d1f694f39bddd569d1c16fe
from binance.client import Client
import time
def get_historical_klines(symbol, interval, start_str, end_str=None):
"""Get Historical Klines from Binance
@davidlenz
davidlenz / reddit_comment_stream_with_praw_example.py
Created April 24, 2018 16:22
Downloads all comments from given subreddits and also extracts text from urls in comments. Details the usage of reddit praw module.
import newsapi_v2
import findurls
import praw
import pandas as pd
import utils_func
import os
import time
import subreddit
import requests
from newspaper import fulltext
@davidlenz
davidlenz / svg_to_pdf.py
Created April 24, 2018 15:32
SVG to PDF using svglib and reportlab
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF
def svg_to_pdf(in_path, out_path):
# svg to pdf
drawing = svg2rlg(in_path)
renderPDF.drawToFile(drawing, out_path)