Scrapes data from Yahoo!Finance Earnings Calendar

yahoo-earnings-calendar的Python项目详细描述


雅虎!收益日历刮刀

codecovBuild Status

刮雅虎!财务收益日历,获取特定日期或日期范围的数据。

安装

PIP

pip install yahoo_earnings_calendar

用法

获取特定日期或日期范围内的收益日期信息

importdatetimefromyahoo_earnings_calendarimportYahooEarningsCalendardate_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))

数据属性

  • 公司简称:公司名称
    • 例如,20160606
  • 票务员:票务员
    • 例如,aapl
  • StartDateTime:事件开始时间
    • 例如,2017-04-23t21:00:00.000-04:00
  • startDateTimeType:事件开始时间类型
    • 例如,TAS(未提供时间)、AMC(市场关闭后)
  • epsEstimate:eps估计
  • epsactual:报告的eps
  • epsSurpricePCT:惊喜百分比
  • gmtoffsetmillistices:gmt偏移量(毫秒)

获取特定符号的下一个收益日期

importdatetimefromyahoo_earnings_calendarimportYahooEarningsCalendaryec=YahooEarningsCalendar()# Returns the next earnings date of BOX in Unix timestampprint(yec.get_next_earnings_date('box'))# 1508716800

设置请求之间的延迟

默认情况下,请求延迟1.8秒,以避免超过2000/小时的速率限制。可以通过向YahooEarningsCalendar构造函数传递参数来覆盖默认延迟。

importdatetimefromyahoo_earnings_calendarimportYahooEarningsCalendarmy_custom_delay_s=0.5yec=YahooEarningsCalendar(my_custom_delay_s)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Kafka producer大量内存使用(泄漏?)   java NullPointerException。。。正在插入数据但无法检索数据[Mysql DB]   java spring+jpa+hibernate=没有可用于当前线程的实际事务的EntityManager无法可靠地处理“persist”调用   getelementbyid在没有ID的情况下如何在java中使用GetElementsById   java有没有一种使用WatchService强制轮询的方法?   java将值从jframe传递给另一个jframe并使用它   Java/Groovy中带重试的反应式事件处理   具有两个包装器元素的java Jackson XML ArrayList输出   java总是在范围内使用不同的随机元素   取消选择java下拉列表值   多线程如何在Java中为对象的不同成员拥有不同的同步块   java如何使用多线程从文本文件中读取输入   java Spring启动附加崩溃命令   java使用公共或单独的actionPerfomed方法有什么区别   java用Spring3.0中的SpEL替换JSP中的EL   java作为windows服务运行应用程序时无法访问共享文件夹   java xml 1.1规范中的“解析数据”是什么意思?   以编程方式设置JComboBox索引时java触发ItemListener   java Android WebView:只加载HTML,不加载JS或CSS(在某些设备中)   Java:计算do/while循环的数量