Scrapes data from Yahoo! Finance earnings calendar
Project description
Yahoo! Earnings Calendar Scraper
Scrapes Yahoo! Finance earnings calendar to get data for a specific date or a date range.
Installation
Pip
pip install yahoo_earnings_calendar
Usage
Get earnings date information on a specific date or in a date range
import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar
date_from = datetime.datetime.strptime(
'May 5 2017 10:00AM', '%b %d %Y %I:%M%p')
date_to = datetime.datetime.strptime(
'May 8 2017 1:00PM', '%b %d %Y %I:%M%p')
yec = YahooEarningsCalendar()
print(yec.earnings_on(date_from))
print(yec.earnings_between(date_from, date_to))
Data attributes
- companyshortname: Company Name
- e.g., 20160606
- ticker: Ticker
- e.g., AAPL
- startdatetime: Event Start Time
- e.g., 2017-04-23T21:00:00.000-04:00
- startdatetimetype: Event Start Time Type
- e.g., TAS (Time Not Supplied), AMC (After Market Close )
- epsestimate: EPS Estimate
- epsactual: Reported EPS
- epssurprisepct: Surprise (%)
- gmtOffsetMilliSeconds: GMT Offset in MS
Get the next earnings date of a specific symbol
import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar
yec = YahooEarningsCalendar()
# Returns the next earnings date of BOX in Unix timestamp
print(yec.get_next_earnings_date('box'))
# 1508716800
Set delay between requests
By default, requests are delayed by 1.8 sec to avoid exceeding the 2000/hour rate limit. You can override the default delay by passing an argument to the YahooEarningsCalendar
constructor.
import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar
my_custom_delay_s = 0.5
yec = YahooEarningsCalendar(my_custom_delay_s)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for yahoo_earnings_calendar-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67d97f36174ba2102c160731ded8c7c18a9398bb3f25898ed5bb44014d5f4434 |
|
MD5 | f940a712883a7391967d337e92679750 |
|
BLAKE2b-256 | b08b75944df4ec37014bd65b2f62578187a3b015f15164cdac68b5dcd9e72f31 |
Close
Hashes for yahoo_earnings_calendar-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107f57c9c273548a6a74ed15bbcb19e36f33945a36370a4849b4143dc3718362 |
|
MD5 | 5dbd809111ff64f3604ec77adfd82caa |
|
BLAKE2b-256 | 5776ac83bf3e004bb72087f64c9873939b1f9d4e78b1d3c20a7535291de2fda0 |