Generative AI

Step Guide Guide to move streamlit app using CloudFlared, Beautiful, Pandas, Plotly for Real-Time for Cryptocurrency Web Suggestion and View

In this lesson, we will go honest and useless using the cloudflared, a cloudflare tool that provides a secure, accessible link in your streamlit application. At the end of this guide, we will find a fully functioning dashboard that moves humorous cryptocurrency and see real-time prices from EcoinMarketcap. You can track 10 top Cryptocurries, comparing their prices and capitals in market fields, and view active charts for better information.

!pip install streamlit requests beautifulsoup4 pandas matplotlib plotly
!npm install -g localtunnel

First, the above order includes the leaning needed for construction and submitting CRYPTOurCUCURCURCURCENCECTURCENCE based on the broadcast. The first command includes the key python libraries such as the Slimin Web app, BeaupSoupe of Web Supplies, Pandas delusion of data, and voyedly for visual opinion. The second commandment includes LocalTuntNel, which forms the public URL for the sale of Salletit from Colob.

%%writefile app.py
import streamlit as st
import requests
from bs4 import BeautifulSoup
import pandas as pd
import plotly.express as px


# Function to scrape cryptocurrency prices
def scrape_crypto_prices():
    url = "
    headers = {"User-Agent": "Mozilla/5.0"}
    response = requests.get(url, headers=headers)
   
    if response.status_code != 200:
        return pd.DataFrame(), "Error fetching data."
   
    soup = BeautifulSoup(response.text, "html.parser")
    rows = soup.select("tbody tr")[:10]  # Get top 10 cryptocurrencies
   
    data = []
    for row in rows:
        columns = row.find_all("td")
        name = columns[2].find("p").text  # Crypto name
        symbol = columns[2].find("p", class_="coin-item-symbol").text  # Symbol
        price = columns[3].text  # Price
        change = columns[4].text  # % Change
        market_cap = columns[6].text  # Market Cap
        data.append([name, symbol, price, change, market_cap])
   
    return pd.DataFrame(data, columns=["Name", "Symbol", "Price", "% Change", "Market Cap"]), None


# Streamlit UI
st.title("📈 Live Cryptocurrency Prices")


data, error = scrape_crypto_prices()
if error:
    st.error(error)
else:
    st.dataframe(data)


    data["Price"] = data["Price"].replace({"$": "", ",": ""}, regex=True).astype(float)


    fig = px.bar(data, x="Symbol", y="Price", color="Name", title="Top 10 Cryptos by Price")
    st.plotly_chart(fig)
   
    fig_market_cap = px.pie(data, names="Name", values="Market Cap", title="Market Cap Distribution")
    st.plotly_chart(fig_market_cap)


# Footer
st.markdown("🔄 Data scraped from CoinMarketCap. Updated in real-time.")

Here, explaining a web site app that threatens real-time prices in Cryptocurrency Prices from EcoinMarketcap and show it the contact dashboard. Using a beautiful 10 Cryptoculers, including their name, seal, price, percentage, and market fees. Flexible data are processed using pandas and accidentally recognized. The app shows a price comparison and a market for the market distribution pie. The app shows an error message in case of an error while downloading data. Finally, a foot note shows that variable data updates from CoinMarketcap.

import subprocess
import time


# Start Streamlit in the background
subprocess.Popen(["streamlit", "run", "app.py", "--server.port=8501"])


# Wait for Streamlit to start
time.sleep(5)


# Start Cloudflare tunnel and expose the app
!./cloudflared tunnel --url  --no-autoupdate

Finally, the above code starts the saleypess app for SUBPROCESS.Popen and allows you to activate the Cloud URL, which forms the Cloud URL to reach the app from Google Colab without verification or added.

App View
Download data csv file

In conclusion, this lesson granted the action guide to the construction and sending the Cryptocurrency tracking app for Cryptocurlocursency app using broadcasting, beauty, pandas and creating applications. We have successfully appealed the Live Crypto data from Coinmarketcap, showing the communication dashboard, we could give attention to the seamlessly using the cluckflared. Unlike traditional management methods, this method ensures easy shipment without proof of authenticity. Whether you are a web test startup and the viewing of data or engineer you want to lose the way, which is accessible, the tutorial equipment is to equip the construction tools and sharing effective web apps.


Here is the Colab Notebook including CSV file of the above project. Also, don't forget to follow Sane and join ours Telegraph station including LinkedIn Grtopic. Don't forget to join ours 80k + ml subreddit.

🚨 Recommended Recommended Research for Nexus


Asphazzaq is a Markteach Media Inc. According to a View Business and Developer, Asifi is committed to integrating a good social intelligence. His latest attempt is launched by the launch of the chemistrylife plan for an intelligence, MarktechPost, a devastating intimate practice of a machine learning and deep learning issues that are clearly and easily understood. The platform is adhering to more than two million moon visits, indicating its popularity between the audience.

🚨 Recommended Open-Source Ai Platform: 'Interstagent open source system with multiple sources to test the difficult AI' system (promoted)

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button