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
<VirtualHost *:80> | |
ServerName localhost | |
WSGIDaemonProcess html user=apache group=apache threads=2 | |
WSGIScriptAlias / /var/www/html/wsgi.py | |
<Directory /var/www/html> | |
Require all granted |
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
import os | |
from app import app | |
if __name__ == "__main__": | |
port = int(os.environ.get("PORT", 5000)) | |
app.run(host='0.0.0.0', port=port, debug=True) |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello world!" |
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
from models.PyCryptoBot import PyCryptoBot | |
from models.exchange.coinbase_pro import PublicAPI as CPublicAPI | |
from models.Trading import TechnicalAnalysis | |
app = PyCryptoBot(exchange='coinbasepro') | |
api = CPublicAPI() | |
df = app.getHistoricalDataChained('BTC-GBP', 3600, 5) | |
model = TechnicalAnalysis(df) | |
model.addAll() |
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
import json | |
import boto3 | |
import botocore.config | |
import pymysql | |
client = boto3.client('s3', 'eu-west-1', config=botocore.config.Config(s3={'addressing_style':'path'})) | |
def lambda_handler(event, context): | |
bucket_name = event["Records"][0]["s3"]["bucket"]["name"] | |
s3_file_name = event["Records"][0]["s3"]["object"]["key"] |
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
import json | |
import boto3 | |
import email | |
import os | |
from datetime import datetime | |
import re | |
def get_timestamp(): | |
current = datetime.now() | |
return(str(current.year) + '-' + str(current.month) + '-' + str(current.day) + '-' + str(current.hour) + '-' + str(current.minute) + '-' + str(current.second)) |
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
def mount_gdrive(): | |
if not os.path.isdir('/content/gdrive'): | |
drive.mount('/content/gdrive') | |
def build(): | |
root_dir = os.environ['GDRIVE_ROOT'] | |
project_name = os.environ['PROJECT_NAME'] | |
tensorflow_model = os.environ['TENSORFLOW_MODEL'] | |
os.chdir(f'/content/gdrive/MyDrive/{root_dir}/models/research') |
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
def mount_gdrive(): | |
if not os.path.isdir('/content/gdrive'): | |
drive.mount('/content/gdrive') | |
def create_gdrive_directory_structure(): | |
global labels | |
root_dir = os.environ['GDRIVE_ROOT'] | |
project_name = os.environ['PROJECT_NAME'] | |
tensorflow_model = os.environ['TENSORFLOW_MODEL'] |
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
""" Sample TensorFlow XML-to-TFRecord converter | |
usage: generate_tfrecord.py [-h] [-x XML_DIR] [-l LABELS_PATH] [-o OUTPUT_PATH] [-i IMAGE_DIR] [-c CSV_PATH] | |
optional arguments: | |
-h, --help show this help message and exit | |
-x XML_DIR, --xml_dir XML_DIR | |
Path to the folder where the input .xml files are stored. | |
-l LABELS_PATH, --labels_path LABELS_PATH | |
Path to the labels (.pbtxt) file. |
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
import re | |
import requests | |
from datetime import datetime | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
if not isinstance(market, str): | |
raise Exception('Market string input expected') | |
if not isinstance(granularity, int): |