from datetime import date, datetime import streamlit as st import yfinance as yf import plotly.express as px from webpages import code_editor as ce def pythonx_lesson3(): st.title("Lesson 3: Collecting Stock Data Through API") st.header(":one: What is API") st.markdown( """ API stands for **Application Programming Interface**. It is a set of protocols, routines, and tools for building software and applications. An API defines the way by which an external client can request services and access data from an operating system, library, or application. It provides a communication interface for two or more systems to exchange data and interact with each other. APIs are commonly used to enable developers to create new applications and services that integrate with existing systems or to extract data from websites and services for use in other applications. """) st.image("./images/lesson3-api.png") st.header(":two: Using yfinance Library(Package) to Extract Stock Data") st.markdown(""" [yfinance](https://github.com/ranaroussi/yfinance) is a Python library that allows you to easily download and analyze financial data from Yahoo Finance. It provides a convenient way to access stock market data and perform various operations with it such as - retrieving historical data - getting real-time data - obtaining financial ratios and metrics, and more. It provides a simple and efficient way to work with stock data in Python, without the need to manually scrape data from websites or manually download data from financial sources. """) st.header(":three: Application Demo") # print text formatted by HTML st.markdown( "