Code Monkey home page Code Monkey logo

yahoofinancer's People

Contributors

aravindhebbali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rnaimehaom

yahoofinancer's Issues

Release yahoofinancer 0.1.0

First release:

Prepare for release:

  • git pull
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Suggested packages should be used conditionally

* checking tests ... ERROR
   Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
   > # This file is part of the standard setup for testthat.
   > # It is recommended that you do not modify it.
   > #
   > # Where should you do additional test configuration?
   > # Learn more about the roles of various files in:
   > # * https://r-pkgs.org/tests.html
   > # *
https://testthat.r-lib.org/reference/test_package.html#special-files
   >
   > library(testthat)
   > library(yahoofinancer)
   >
   > test_check("yahoofinancer")
   Error in `FUN()`:
   ! In path:
"D:\\library-devel\\yahoofinancer.Rcheck\\tests\\testthat\\setup.R"
   Caused by error in `library()`:
   ! there is no package called 'httptest'
   Backtrace:
        ▆
     1. ├─testthat::test_check("yahoofinancer")
     2. │ └─testthat::test_dir(...)
     3. │   └─testthat:::test_files(...)
     4. │     └─testthat:::test_files_serial(...)
     5. │       └─testthat:::test_files_setup_state(...)
     6. │         └─testthat::source_test_setup(".", env)
     7. │           └─testthat::source_dir(path, "^setup.*\\.[rR]$", env
= env, wrap = FALSE)
     8. │             └─base::lapply(...)
     9. │               └─testthat (local) FUN(X[[i]], ...)
    10. │                 └─testthat::source_file(path, env = env, chdir
= chdir, wrap = wrap)
    11. │                   ├─base::withCallingHandlers(...)
    12. │                   └─base::eval(exprs, env)
    13. │                     └─base::eval(exprs, env)
    14. │                       └─base::library(httptest) at
D:\library-devel\yahoofinancer.Rcheck\tests\testthat\setup.R:1:1
    15. │
└─base::stop(packageNotFoundError(package, lib.loc, sys.call()))
    16. └─testthat (local) `<fn>`(`<pckgNtFE>`)
    17.   └─rlang::abort(...)
   Execution halted

Missing data fields in yahoofinacier

I am trying to retrieve some fields in yahoofinancier that should be available according to the documentation: https://www.r-bloggers.com/2022/11/introducing-yahoofinancer/

When I run the script below it returns values for high, low, volume, forward PE, 50 day average, and 200 day average
But it returns NULL values for beta, averageVolume, averageVolume10days

Can someone advise why these values return as NULL?

Thank you!

#-----------------sample script
#load the library
library(yahoofinancer)

#----------------------------------------

select ticker and date range

tickerSymbol <- 'aapl'
startDate <- '2023-11-01'
endDate <- '2023-12-21'
interval <- '1d'
#---------------------------------------

create ticker class

ticker <- Ticker$new(tickerSymbol)

build dataframe of stock history

df <- ticker$get_history(start = startDate, end = endDate, interval = interval)
df <- data.frame(df)

get desired stats

fwdPE <- ticker$quote$forwardPE
avgVol <- ticker$quote$averageVolume
avg10dVol <- ticker$quote$averageVolume10days
avg50d <- ticker$quote$fiftyDayAverage
avg200d <- ticker$quote$twoHundredDayAverage
beta <- ticker$quote$beta 

New error message when I'm using yahoofinancer

Hello,
I am a regular user of the R package yahoofinancer. The last time I used it, in May, it worked perfecty.

But now in October, I had this issue:

y <- Ticker$new("GOOG")
y.yearly <- y$get_income_statement('annual')
Yahoo Finance API request failed
Status: 401
Type: Client error
Mesage:
Descript

Then, I updated the R package 'yahoofinancer' from github and I now get this message:

y <- Ticker$new("GOOG")
y.yearly <- y$get_income_statement('annual')
Error: attempt to apply non-function

Would it be possible that the get_income_statement() function does not work anymore because of changes in the yahoo API features?

Thanks a lot.

Row mismatch

nz50 = Index$new('^NZ50')
nz = nz50$get_history(start = '2003-01-03', interval = '1d')

produces

Error in $<-.data.frame(*tmp*, adj_close, value = c(1954.9599609375, :
replacement has 5070 rows, data has 5191

nz50 = Ticker$new('^NZ50')
nz = nz50$get_history(start = '2003-01-03', interval = '1d')

produces

Error in data.frame(date = as_datetime(unlist(data$timestamp)), volume = unlist(indicators$volume), :
arguments imply differing number of rows: 5191, 5070

Incorrect package alias

From CRAN:

Dear maintainer,

You have file 'yahoofinancer/man/yahoofinancer.Rd' with
\docType{package}, likely intended as a package overview help file, but
without the appropriate PKGNAME-package \alias as per "Documenting
packages" in R-exts.

This seems to be the consequence of the breaking change

  Using @docType package no longer automatically adds a -package alias.
  Instead document _PACKAGE to get all the defaults for package
  documentation.

in roxygen2 7.0.0 (2019-11-12) having gone unnoticed, see
<https://github.com/r-lib/roxygen2/issues/1491>.

As explained in the issue, to get the desired PKGNAME-package \alias
back, you should either change to the new approach and document the new
special sentinel

  "_PACKAGE"

or manually add

  @aliases yahoofinancer-package

if remaining with the old approach.

Please fix in your master sources as appropriate, and submit a fixed
version of your package within the next few months.

Best,
-k

Release yahoofinancer 0.3.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Tweet

Lots of zeros abnormally obtained when downloading companies' financials

Hello,
I'm using the 'yahoofinancer' package to download quartely financials from yahoo. In the last few weeks, I have faced this issue:
I get 0 values for many financial metrics for the last available quarter. For example, when loading the 'alphabet' quarterly financials, I get 0s for variables such as 'total revenues' or 'net income' for quarter ending '2023-03-31', although non-zero values are displayed on yahoo.finance.com (https://finance.yahoo.com/quote/GOOG/financials?p=GOOG).

alphabet.financials <- Ticker$new("GOOG")$get_income_statement('quarter')
print(alphabet.financials[,c("end_date","total_revenue","ebit","net_income")])

A tibble: 4 × 4

end_date total_revenue ebit net_income

1 2023-03-31 0 17415000000 0
2 2022-12-31 76048000000 18160000000 13624000000
3 2022-09-30 69092000000 17135000000 13910000000
4 2022-06-30 69685000000 19453000000 16002000000

no internet connection using validate

I know and checked the I have internet connection when using R, but I still get a no internet connection when I use the function validate.
Ex: validate("AAPL") does not give my any result other then no internet connection.

Release yahoofinancer 0.2.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

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.