Skip to content

Instantly share code, notes, and snippets.

View freelancing-solutions's full-sized avatar
💯
Available

mobius-crypt freelancing-solutions

💯
Available
View GitHub Profile
@freelancing-solutions
freelancing-solutions / generalfundametal.py
Created December 25, 2022 06:27
A faster way of processing and storing stock ticker data from eod api
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
@freelancing-solutions
freelancing-solutions / generalfundametal.py
Created December 24, 2022 16:18
high performance exchange data processor
@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')
@freelancing-solutions
freelancing-solutions / technicalfundamental.py
Created December 6, 2022 16:28
just coded fundamental data technical indicator data source
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
@freelancing-solutions
freelancing-solutions / stock.py
Created November 27, 2022 13:27
Stock API, Implementation
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
@freelancing-solutions
freelancing-solutions / __init__.py
Created November 15, 2022 16:03
creating a config file using pydantic
"""
**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/"
@freelancing-solutions
freelancing-solutions / main.py
Created November 15, 2022 15:53
a better way to start a python web api
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'])
@freelancing-solutions
freelancing-solutions / mutablestring.py
Created July 7, 2022 16:21
a mutable python string
""" a mutable sting"""
class String(str):
def __new__(cls, *args, **kwargs):
return str.__new__(cls, *args, **kwargs)
def __strip__(self):
@freelancing-solutions
freelancing-solutions / bouncer.py
Created October 21, 2021 07:12
simple userfeed models with nice average calculations
"""
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"
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):
@freelancing-solutions
freelancing-solutions / Learning.py
Created October 14, 2021 08:49
creating lists
def create_list(input_1, input_2):
return [input_1, input_2]
# or
def create_list(*args):
return [arg for arg in args]