sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
import asyncio | |
class AsyncConstructorMeta(type): | |
"""Metaclass to support asynchronous constructors in Python. | |
Basically we're exploiting the fact that __new__ can return anything in Python. | |
So we're taking the old __init__ code, removing it from the class, and instead, | |
we create a custom __new__ method that returns a coroutine wrapping the original | |
constructor. |
drop table if exists shipments; | |
create table shipments ( | |
id serial primary key not null, | |
sender_address_id integer not null, | |
sender_contact_id integer not null, | |
receiver_address_id integer not null, | |
receiver_contact_id integer not null, | |
created_at timestamp not null default current_timestamp, | |
units integer not null, | |
zar_value numeric not null |
<? | |
// | |
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio) | |
// | |
// File: twitterFollowerCuratorBot.php | |
// | |
// Created: May 2021 | |
// License: MIT | |
// |
>> python3 valuation.py -t enph -i | |
Fetching industries data ... | |
Processing ENPH | |
Solar (US): ['ENPH', 'RUN', 'FSLR', 'SPWR', 'SHLS', 'VSLR', 'NOVA', 'BEEM', 'SUNW', 'PECK', 'EVSI'] | |
Fetching data for ENPH | |
Starting DCF calculation for ENPH | |
Equity %: 94% | |
Cost / equity = riskfree rate + beta * country ERP | |
Cost / equity = 2% + 1.13349 * 0.09 |
#import required modules | |
from bs4 import BeautifulSoup | |
import ast | |
import pandas as pd | |
import re | |
import requests | |
from datetime import datetime | |
def get_stock_price(ticker): | |
# pass a ticker name to i3investor website url |