-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconstants.py
56 lines (51 loc) · 1.34 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""Constants class"""
# Directories & Files
CONFIG_FILE = 'matrix/config.json'
CONFIG_SCHEMA = 'matrix/config.schema.json'
LAYOUT_FILE = 'matrix/coords/w{}h{}.json'
LOG_FILE = 'led-stock-ticker.log'
LOADING_IMAGE = 'assets/img/logo.png'
ERROR_IMAGE = 'assets/img/error.png'
FONTS_DIR = 'assets/fonts/'
# Software Defaults
DEFAULT_STOCKS = [
'TSLA',
'AMZN',
'MSFT'
]
DEFAULT_CRYPTOS = [
'BTC',
'ETH',
'LTC'
]
DEFAULT_FOREX = [
'USD/EUR',
'EUR/JPY',
'GBP/USD'
]
DEFAULT_CURRENCY = 'USD'
DEFAULT_DATE_FORMAT = '%a, %b %d' # eg. Sun, Jan 5
DEFAULT_UPDATE_RATE = 10 * 60 # 10 minutes
DEFAULT_ROTATION_RATE = 10 # seconds
TEXT_SCROLL_DELAY = 0.5 # seconds
TEXT_SCROLL_SPEED = 0.3 # seconds
# Exchange Rate API
CURRENCY_EXCHANGE_URL = 'https://open.er-api.com/v6/latest/USD'
# Image sources
STOCK_LOGO_URL = 'https://logo.clearbit.com/{}'
CRYPTO_LOGO_URL = 'https://coinicons-api.vercel.app/api/icon/{}'
FLAG_URL = 'https://raw.githubusercontent.com/vivekimsit/currency-flags/master/src/flags/{}.png'
# Date/Time Formatting
DATE_FORMATS = [
'%a, %b %d', # Sun, Jan 5
'%B %d', # January 5
'%m/%d/%Y', # MM/DD/YYYY
'%a, %d %b', # Sun, 5 Jan
'%d/%m/%Y', # DD/MM/YYYY
]
CLOCK_FORMATS = [
'12h',
'24h'
]
TWELVE_HOURS_FORMAT = '%I:%M %p' # eg. 11:38 PM
TWENTY_FOUR_HOURS_FORMAT = '%H:%M' # eg. 23:38