forked from ExpDev07/coronavirus-tracker-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
28 lines (21 loc) · 758 Bytes
/
__init__.py
File metadata and controls
28 lines (21 loc) · 758 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
"""app.data"""
from ..services.location.csbs import CSBSLocationService
from ..services.location.jhu import JhuLocationService
from ..services.location.nyt import NYTLocationService
class Source:
def __init__(self, source):
# Mapping of services to data-sources.
self.__DATA_SOURCES_LIST = {
"jhu": JhuLocationService(),
"csbs": CSBSLocationService(),
"nyt": NYTLocationService(),
}
def all_data_source(self):
return self.__DATA_SOURCES_LIST
def single_data_source(self, source):
"""
Retrieves the provided data-source service.
:returns: The service.
:rtype: LocationService
"""
return self.__DATA_SOURCES_LIST.get(source.lower())