mbnlc / yflive Goto Github PK
View Code? Open in Web Editor NEWLive Data Streamer for Yahoo! Finance
Home Page: https://pypi.org/project/yflive/
License: Apache License 2.0
Live Data Streamer for Yahoo! Finance
Home Page: https://pypi.org/project/yflive/
License: Apache License 2.0
Greetings,
I have observed that the web socket is automatically closed after a certain interval of time.
When we subscribe to certain scripts that have very low trading going on, ticks for these symbols may come minutes apart sometimes. I suspected that the Yahoo servers may be seeing no activity for these periods and actively closing the web socket, so I added an market index to the subscription list which has very good tick flow.
This too resulted in the web socket closing automatically. I was hoping there would be a way to keep the web socket alive for the duration of the market ( 6 hours 30 minutes to be precise ), so that I will not have to restart my code every time it fails.
Seeking your suggestions and advise on this.
Regards
Thanks a lot for this very useful module! It works great! I was wondering if there is asyncio support. I also tried the threading option setting to true but this terminated the run without an error (using the sample code you provide in README). Have you tested with multiple stocks and know limitations, how computationally demanding is given an increasing number of subscriptions?
Greetings
from yflive import QuoteStreamer
qs = QuoteStreamer()
qs.subscribe(["AAPL", "TSLA"])
qs.on_quote = lambda q: print(q)
qs.start()
# unreachable code
print("unreachable code.")
After running your code I noticed anything put after qs.start()
is unreachable till the ws
is active. I would like to request you kindly see if it will be possible to thread the self._websocket.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})
so that it can run in the background as a daemon. If possible please also include a mechanism to stop the ws
after its no more required.
Kindly check Upstox-API to see an example. Thank You.
qs = QuoteStreamer()
qs.subscribe(["AAPL", "TSLA"])
qs.on_quote = lambda q: print(q) <------ ???
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.