Skip to content

Instantly share code, notes, and snippets.

View tommycotter's full-sized avatar
🎯
Focusing

tommycotter

🎯
Focusing
View GitHub Profile
@tommycotter
tommycotter / ratings_aggregation
Created November 15, 2023 16:57
JS Analyst Ratings Aggregation
import { getGlobalSession } from '../../session';
import { CalendarManager, Ratings } from '@benzinga/calendar-manager';
import { SafePromise } from '@benzinga/safe-await';
import _ from 'lodash';
import { Session } from '@benzinga/session';
import { DateTime } from 'luxon';
export interface AnalystRatingsSummary {
aggregateRatings: RatingsAggregate;
consensusPriceTarget: string;
@tommycotter
tommycotter / ip_locator
Last active January 10, 2023 01:19
Prints the lat / long of IP addresses
import csv
import requests
import pandas as pd
import plotly.express as px
import time # add the time module
import random # add the random module
# initialize lists to store the IP addresses and coordinates
ips = []
coords = []
@tommycotter
tommycotter / cufflinks_4
Created December 15, 2022 19:29
cufflinks_4
@tommycotter
tommycotter / cufflinks_3
Created December 15, 2022 19:28
cufflinks_3
@tommycotter
tommycotter / cufflinks_2
Created December 15, 2022 19:28
cufflinks_2
@tommycotter
tommycotter / cufflinks_1
Last active December 18, 2022 18:32
cufflinks_1
@tommycotter
tommycotter / dkng_plot.py
Last active August 16, 2022 22:09
Benzinga Quotes API
import pandas as pd
import plotly.graph_objects as go
# Import data from the Benzinga Python SDK
from benzinga import financial_data
api_key = "YOUR_API_KEY"
fin = financial_data.Benzinga(api_key)
# Set up the dataframe
df = pd.DataFrame(fin.bars(company_tickers="DKNG",
@tommycotter
tommycotter / bz_analyst.py
Last active August 2, 2022 15:03
benzinga_analyst_ratings_plot
from this import d
from tracemalloc import start
import requests
import plotly.express as px
import datetime
import pandas as pd
import json
# Add API paramters
@tommycotter
tommycotter / logos_schema
Created July 18, 2022 18:12
Logos Response
{
"id": "123456789",
"search_key": "AAPL",
"files": {
"logo_dark": "https://imageURL-1.benzinga.com",
"logo_light": "https://imageURL-2.benzinga.com",
"logo_vector_dark": "https://imageURL-3.benzinga.com",
"logo_vector_light": "https://imageURL-4.benzinga.com",
"mark_composite_dark": "https://imageURL-5.benzinga.com",
"mark_composite_light": "https://imageURL-6.benzinga.com",