fbriden / yahoo-finance-rs Goto Github PK
View Code? Open in Web Editor NEWA Rust library for getting financial information from Yahoo!
License: MIT License
A Rust library for getting financial information from Yahoo!
License: MIT License
Things such as exchange name, exchange timezone, currency, etc.
The main README.md needs to be updated to reflect that the historical functions are now async
We need a way to get realtime ticker updates from Yahoo over websockets. The API needs to be able to add and remove listeners for ticker symbols. When a new message comes over websockets indicating something has changed for the ticker symbol a callback for the symbol needs to be called so work can be done.
If I understand correctly, here we use u64
to hold the timestamp, which obviously doesn't work if the timestamp is negative (before 1970-01-01T00:00:00Z):
yahoo-finance-rs/src/yahoo/chart.rs
Line 33 in 97499b8
So it needs to be changed to i64
.
We need an API to get profile information on a company, based on the symbol. Look for information like, sector, industry, description, name, address, etc
Hi, thank's for writing this little library, saves me from doing it myself... ;-)
However, I observed that for some valid ticker, the library panics, crashing my application which is based on it. Here is an example:
use yahoo_finance::history;
use std::time::{Duration, UNIX_EPOCH};
use chrono::{DateTime,Utc};
fn main() {
let data = history::retrieve("ISPFF").unwrap();
for bar in &data {
println!("On {} ISPFF closes at ${:.2}",
DateTime::<Utc>::from(UNIX_EPOCH + Duration::from_secs(bar.timestamp)), bar.close)
}
}
Apparently, the cause is that yahoo delivers a null value in field firstTradeDate
, which causes the unwrap
in line 31 of chart.rs
to panic:
let response: Response = serde_json::from_str(x).unwrap();
Could you consider to return a Result
instead of letting the library panic? In this case, the application calling the library could decide how to deal with it. Of course, you could just avoid using these ticker (which is recommended anyway since yahoo delivers only sparse data for that one), but I would prefer if I could check that without testing for panic.
I hit this issue on some code that does incremental update of the historical data. When trying to get data starting from 2020-09-05, I got a Bar for 2020-09-04 with a time of 20:08. I tested with all Utc DateTimes and setting various times, it seems to consistently return data for 2020-09-04.
Under certain circumstances Yahoo can return indicators without quote data. We need to be able to gracefully handle these scenarios
We need an API to retrieve the OHLCV data for a period of time. The API needs to accept a ticker symbol, an optional interval (defaulting to 3 months) and an optional end date - where the final range will be between start date & end date where start date is end date - interval. The API needs to use a std::Result so that an error can be returned if one occurs
I really need to mock out the yahoo calls to harden against error cases
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.