Skip to content

Instantly share code, notes, and snippets.

@Socvest
Socvest / ticker.py
Created April 13, 2025 19:08 — forked from leftmove/ticker.py
Company name to ticker using Yahoo Finance API endpoint
def get_ticker(company_name):
yfinance = "https://query2.finance.yahoo.com/v1/finance/search"
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
params = {"q": company_name, "quotes_count": 1, "country": "United States"}
res = requests.get(url=yfinance, params=params, headers={'User-Agent': user_agent})
data = res.json()
company_code = data['quotes'][0]['symbol']
return company_code
@Socvest
Socvest / WaterfallChart.tsx
Created March 27, 2024 22:38 — forked from mdesousa/WaterfallChart.tsx
Waterfall bar chart with Nivo (includes WrappedTick component)
import { TickFormatter } from "@nivo/axes";
import { ResponsiveBar, ValueFormatter } from "@nivo/bar";
import { useTheme } from "@nivo/core";
interface IWaterfallDatum {
category: string;
amount: number;
}
interface IWaterfallBarDatum {