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 asyncio | |
import functools | |
from asyncio import Future | |
from typing import List, Optional, Tuple, Coroutine, Callable | |
from google.cloud import ndb | |
from src.external_data.eod import DataSource | |
from src.external_data.eod.data_types import MDict | |
from src.main.loader import eod_data_source |
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
@ndb.toplevel | |
async def update_exchanges_from_eod(self) -> List[ndb.Key]: | |
""" | |
from eod obtain exchange lists and then save it on the database | |
https://eodhistoricaldata.com/api/exchanges-list/?api_token=api_token&fmt=json | |
:return: | |
""" | |
# TODO -> Refactor this - the method should not be here | |
eod_url: str = self._src.base_url | |
args: MDict = dict(api_token=self._src.api_token, fmt='json') |
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 asyncio | |
from google.cloud import ndb | |
from src.external_data.eod import DataSource | |
from src.main.loader import eod_data_source | |
from src.models.fundamental import FundamentalTechnicals | |
from src.models.temp.fundamental import TempFundamentalJSON | |
from src.parsers import FundamentalTechnicalsParser, MDict |
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 asyncio | |
from asyncio import Future | |
from typing import Callable, List, Tuple, Dict | |
from flask import Response, jsonify | |
from flask_apispec import doc, marshal_with, use_kwargs | |
from src.exceptions import InputError, status_codes | |
from src.main.loader import app_cache | |
from src.models.exchanges import Exchange | |
from src.models.stock import Stock | |
from src.parsers import json_parser |
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
""" | |
**Flask App Configuration Settings** | |
*Python Version 3.8 and above* | |
Used to setup environment variables for python flask app | |
""" | |
__developer__ = "mobius-crypt" | |
__email__ = "mobiusndou@gmail.com" | |
__twitter__ = "@blueitserver" | |
__github_profile__ = "https://github.com/freelancing-solutions/" |
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 typing import Tuple | |
from flask import Flask | |
from src.config import config_instance | |
from src.main.loader import create_app | |
app = create_app(config_class=config_instance()) | |
@app.route('/_ah/warmup', methods=['GET']) |
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
""" a mutable sting""" | |
class String(str): | |
def __new__(cls, *args, **kwargs): | |
return str.__new__(cls, *args, **kwargs) | |
def __strip__(self): |
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
""" | |
Bouncers / Security Guards Module | |
module inherits from user and add bouncer specific functionality | |
""" | |
__developer__ = "mobius-crypt" | |
__email__ = "mobiusndou@gmail.com" | |
__twitter__ = "@blueitserver" | |
__github_profile__ = "https://github.com/freelancing-solutions/" | |
__licence__ = "MIT" |
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 asyncio | |
from typing import List | |
from src.external_data.eod import DataSource | |
from src.models.fundamental import AnnualBalanceSheets, QuarterlyBalanceSheets | |
from src.parsers import FundamentalBalanceSheetYearlyParser, FundamentalBalanceSheetQuarterlyParser | |
from src.utils import create_id | |
class FinancialsDataSource(DataSource): |
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 create_list(input_1, input_2): | |
return [input_1, input_2] | |
# or | |
def create_list(*args): | |
return [arg for arg in args] |