Azure Streamlit

A little mix of azure with streamlit

import azure.storage.blob as azureblob

# Set the connection string, container name, and blob name
connection_string = "your_connection_string"
container_name = "your_container_name"
blob_name = "your_blob_name.csv"

# Create a blob client and get the container reference
blob_client = azureblob.BlockBlobService(connection_string=connection_string)
container = blob_client.get_container_reference(container_name)

# Download the blob to a local file
local_file_name = blob_name
container.get_blob_to_path(blob_name, local_file_name)

# Open the local file and read the CSV data
with open(local_file_name, "r") as file:
    csv_data = file.read()

# Process the CSV data as needed...

You can use this to run your csv file from the blob storage


import streamlit as st
import pandas as pd

# Load the data into a Pandas DataFrame
data = pd.read_csv("your_data.csv")

# Create a function that takes a user ID and returns recommendations
def get_recommendations(user_id):
    # Use the recommendation system to generate recommendations
    recommendations = recommendation_system.predict(user_id)

    # Return the recommendations as a Pandas DataFrame
    return pd.DataFrame(recommendations, columns=["Item ID", "Score"])

# Create a Streamlit app
st.title("Recommendation System")

# Get the user ID from the user
user_id = st.number_input("Enter your user ID:")

# Get the recommendations for the user
recommendations = get_recommendations(user_id)

# Display the recommendations to the user
st.dataframe(recommendations)

some boiler plate code for some recommendation engine