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
from datetime import datetime, timedelta | |
from flask import Blueprint, render_template, request, make_response, flash, redirect, url_for, Response | |
from pydantic import ValidationError | |
from src.logger import init_logger | |
from src.database.models.auth import Auth, RegisterUser | |
from src.database.models.users import User, CreateUser, PasswordResetUser | |
from src.main import user_controller | |
auth_route = Blueprint('auth', __name__) |
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 this_works_just_fine(my_list: list[int] = []) -> list[int]: | |
""" | |
This function will remove the first element of a list | |
""" | |
my_list.pop(0) | |
my_list.reverse() | |
return my_list | |
def still_works(): |
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
class Cache: | |
""" | |
A class to handle caching of data, both in-memory and in Redis. | |
The class provides thread-safe caching and automatic cache eviction when full. | |
:param max_size: The maximum size of the in-memory cache. The default is set in the config file. | |
:param expiration_time: The expiration time of each cache entry, in seconds. The default is set in the config | |
file. | |
:param use_redis: Indicates whether to use a Redis cache. The default is False. | |
""" |
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 Callable, Coroutine, Dict | |
from flask import Blueprint, jsonify | |
from src.authentication.cron_validator import cron_validator | |
from src.exceptions import InputError, RequestError, status_codes | |
from src.external_data.StocklistAPI.update_stock_lists import UpdateStocks | |
from src.external_data.eod.analystrankingsfundamental import \ | |
AnalystRankingsDataSource |
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 collections | |
from CloudFlare.exceptions import CloudFlareAPIError | |
from starlette.requests import Request | |
from src.config import config_instance | |
from CloudFlare import CloudFlare | |
import ipaddress | |
import hashlib | |
import re |
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
async def download_eod_and_store(self, _stock, period, session): | |
""" | |
**download_and_store** | |
download eod data and then store | |
:param _stock: | |
:param period: | |
:param session: | |
:return: | |
""" | |
_data = None |
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 Queue | |
from src.email.templates import EmailTemplate | |
from src.config.config import config_instance | |
from sendgrid import SendGridAPIClient | |
from sendgrid.helpers.mail import Mail | |
class Emailer: | |
""" |
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 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 | |
from src.models.exchanges import Exchange | |
from src.models.fundamental import (FundamentalGeneral, GeneralAddress, GeneralContact, GeneralListings,GeneralOfficers) | |
from src.models.stock import Stock |
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, Generator, Callable, Any, Dict, Union | |
from flask import jsonify | |
from flask_apispec import doc, marshal_with | |
from google.cloud import ndb | |
from src.cache.cache_manager import app_cache | |
from src.exceptions import status_codes | |
from src.models.fundamental import (FundamentalGeneral, GeneralAddress, GeneralContact, GeneralListings, | |
GeneralOfficers, | |
FundamentalHighlights, FundamentalValuation, FundamentalSharesStats, |
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, Optional, Coroutine | |
from google.cloud import ndb | |
from src.external_data.eod import DataSource, MDict | |
from src.main.loader import eod_data_source | |
from src.models.fundamental import FundamentalHighlights | |
from src.models.temp.fundamental import TempFundamentalJSON | |
from src.parsers import FundamentalHighlightsParser | |
from itertools import chain |
NewerOlder