Giter Club home page Giter Club logo

yahoo-earnings-calendar's Introduction

Yahoo! Earnings Calendar Scraper

codecov Build Status

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

Get all the available earnings data of a specific symbol

from yahoo_earnings_calendar import YahooEarningsCalendar

yec = YahooEarningsCalendar()
    # Returns a list of all available earnings of BOX
print(yec.get_earnings_of('box'))

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)

yahoo-earnings-calendar's People

Contributors

wenboyu2 avatar dkadyrov avatar mufniarz avatar yasakawa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.