-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (22 loc) · 737 Bytes
/
main.py
File metadata and controls
40 lines (22 loc) · 737 Bytes
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
from abc import ABC, abstractmethod
from AlphaVAPI.controllers.UrlSetup import CreateUrl
import requests
class Stock_Params(ABC):
@abstractmethod
def print_stock(self): pass
@abstractmethod
def raw_data(self): pass
class SetStock(Stock_Params):
def __init__(self, stock):
self.__stock = stock
self.__url = CreateUrl(self.__stock)
self.__r = requests.get(self.__url)
def price(self):
data = self.__r.json()
print(data)
return data["Global Quote"]['05. price']
def raw_data(self):
data = self.__r.json()
return data
def print_stock(self):
print(self.__stock)