Skip to content

Instantly share code, notes, and snippets.

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
import pandas as pd
class BB():
def __init__(self, df):
self.data = df
self.periods = 30
self.length = 30
self.mult = 2.0
import dash
import dash_core_components as dcc
import dash_html_components as html
import flask
import os
app = dash.Dash()
app.layout = html.Div('Hello World')
@dgnsrekt
dgnsrekt / gb-parse.py
Created June 17, 2018 22:34
idea for parsing bags and estimated value from gunbot.
from pathlib import Path
import os
import json
import pandas as pd
from datetime import datetime
BASEPATH = Path(__file__).parent
exchange = 'binance'
tradepair_state_paths = sorted(BASEPATH.glob(f'{exchange}-BTC-*-state.json'), key=os.path.getmtime, reverse=True)
@dgnsrekt
dgnsrekt / flask_drive_example.py
Created June 23, 2018 11:53 — forked from prahladyeri/flask_drive_example.py
google drive api implementation in python-flask framework
##
# Flask Drive Example App
#
# @author Prahlad Yeri <prahladyeri@yahoo.com>
# @date 30-12-2016
# Dependency:
# 1. pip install flask google-api-python-client
# 2. make sure you have client_id.json in this same directory.
import os
# percent change = new - old / old * 100
dataframe['percent_change'] = (
dataframe['Last'] - dataframe['PrevDay']) / dataframe['PrevDay'] * 100
@dgnsrekt
dgnsrekt / configuration.py
Last active September 9, 2018 02:45
A python configuration concept.
import toml
import structlog
from pathlib import Path
class InvalidSettingError(ValueError):
pass
class ConfigurationBase:
@namespace url(http://www.w3.org/1999/xhtml);
html {
background-color: #002b36 !important;
color: #839496 !important;
font-size: 105%
}
* { /* body, div#content-body, div#body, div#content, h1 */
background: transparent !important;
color: inherit !important;
@dgnsrekt
dgnsrekt / pypi-release-checklist.md
Last active May 14, 2019 02:32 — forked from audreyfeldroy/pypi-release-checklist.md
My PyPI Release Checklist
  • Update HISTORY.rst
  • Commit the changes:
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch