This project tracks Tesla stock data and news, generating a daily chart and updating the README.md automatically via GitHub Actions.
-
Clone the repository:
git clone https://github.com/your-username/tesla-stock-tracker.git cd tesla-stock-tracker -
Install dependencies:
pip install -r requirements.txt
-
API Keys (Optional - for live data):
By default, the project uses static data files (
data/tesla_stock_data.csvandnews/tesla_news.json) included in the repository, allowing it to run out-of-the-box without any API keys.To fetch live stock data from Alpha Vantage and live news from Google Custom Search, you'll need to obtain free API keys:
- Alpha Vantage: Get your free API key
- Google Custom Search: Get your API key and Custom Search Engine ID (CX)
Once you have your keys, set them as environment variables (e.g., in your shell or a
.envfile that you don't commit to Git):export ALPHA_VANTAGE_API_KEY="YOUR_ALPHA_VANTAGE_API_KEY" export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" export GOOGLE_CX="YOUR_GOOGLE_CUSTOM_SEARCH_ENGINE_ID"
-
Run the scripts:
python fetch_data.py python plot_chart.py python fetch_news.py python update_readme.py
For automated daily updates on GitHub, you need to set your API keys as GitHub Secrets in your repository settings:
-
Go to your repository on GitHub.
-
Navigate to
Settings>Secrets and variables>Actions. -
Add the following secrets:
ALPHA_VANTAGE_API_KEYGOOGLE_API_KEYGOOGLE_CX
The workflow
.github/workflows/daily_update.ymlwill then use these secrets to fetch live data and update theREADME.mdautomatically.
fetch_data.py: Fetches Tesla stock data (from Alpha Vantage or uses static data).plot_chart.py: Plots a candlestick chart of Tesla stock data.fetch_news.py: Fetches Tesla news (from Google Custom Search or uses static data).update_readme.py: Updates theREADME.mdwith the latest chart and news.data/: Storestesla_stock_data.csv.news/: Storestesla_news.json.charts/: Storestesla_stock_chart.png.
Source: ir.tesla.com - Tesla's mission is to accelerate the world's transition to sustainable energy. Today, Tesla builds not only all-electric vehicles but also infinitely ...
Press Releases | Tesla Investor Relations
Source: ir.tesla.com - AUSTIN, Texas, January 28, 2026 – Tesla has released its financial results for the fourth quarter and full year ended December 31, 2025 by posting an update ...
Tesla Motors Launches Revolutionary Supercharger Enabling ...
Source: ir.tesla.com - Sep 24, 2012 ... Tesla revealed the locations of the first six Supercharger stations, which will allow the Model S to travel long distances with ultra fast charging.
Tesla Motors Announces 2013 Annual Shareholder Meeting Webcast
Source: ir.tesla.com - Jun 3, 2013 ... PALO ALTO, CA -- (Marketwired) -- 06/03/13 -- Tesla Motors, Inc. (NASDAQ: TSLA) announces the webcast for its 2013 Annual Shareholder ...
Tesla Motors Announces Date for Second Quarter 2012 Financial ...
Source: ir.tesla.com - Jul 19, 2012 ... Tesla Motors, Inc. (NASDAQ: TSLA) announced today that it will post its financial results for the second quarter ended June 30, 2012, after market close on ...
Tesla Motors Begins Regular Production of 2008 Tesla Roadster
Source: ir.tesla.com - Mar 16, 2008 ... Regular production of the 2008 Tesla Roadster commenced today, marking an historical milestone for Tesla Motors and a watershed in the development of clean, ...
Tesla Motors Announces Offerings of Common Stock and ...
Source: ir.tesla.com - May 15, 2013 ... PALO ALTO, CA -- (Marketwired) -- 05/15/13 -- Tesla Motors, Inc. (NASDAQ: TSLA) announced today offerings of 2703027 shares of common stock ...
Tesla Motors Announces Date for Second Quarter 2013 Financial ...
Source: ir.tesla.com - Jul 16, 2013 ... PALO ALTO, CA -- (Marketwired) -- 07/16/13 -- Tesla Motors, Inc. (NASDAQ: TSLA) announced today that it will post its financial results for ...
Tesla Motors Releases Fourth Quarter & Full Year 2011 Financial ...
Source: ir.tesla.com - Feb 15, 2012 ... Tesla Motors Releases Fourth Quarter & Full Year 2011 Financial Results ... PALO ALTO, CA -- (MARKET WIRE) -- 02/15/12 -- Tesla Motors, Inc. ( ...
Tesla Motors Releases Second Quarter 2012 Financial Results
Source: ir.tesla.com - Jul 25, 2012 ... Tesla Motors Releases Second Quarter 2012 Financial Results ... PALO ALTO, CA -- (Marketwire) -- 07/25/12 -- Tesla Motors, Inc. (NASDAQ: TSLA) ...