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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 20px; } | |
@media (min-width: 768px){ | |
body{ padding-top: 150px; } | |
} | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; max-width: 650px; margin: 0 auto; } |
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
# Requires the requests library (install with 'pip install requests') | |
import requests | |
class APIClient(object): | |
BASE_URL = "https://api.octopus.energy/v1" | |
class DataUnavailable(Exception): | |
""" | |
Catch-all exception indicating we can't get data back from the API |