libs.htmgeny module#

class libs.htmlgeny.HtmlGeny[source]#

Bases: object

Initiate the class and creates a copy of the sort-table.js and visitor.js files in the streamlit static folder

add_check_box(steam_url: str, length=6) str[source]#
Parameters:
  • steamurl (str) – steamurl of the game

  • length (int) – length of the hash default is 6

Return type:

str

Example:

add_check_box(”https://steamcommunity.com/market/listings/753/470260-Lower%20deck”)

Returns:

<input type=”checkbox” data-id=”a395d9”>

Takes a steamurl and returns a checkbox with data-id as the hash of the steamurl
using the data-id for a persistent checkbox via local storage
generate_html(steam_data: DataFrame, deviant_data: DataFrame) None[source]#
Parameters:
  • steam_data (pd.DataFrame) – Steam data

  • deviant_data (pd.DataFrame) – Deviant data

Return type:

None

Example:

generate_html(steam_data, deviant_data)

Returns:

None

Generates the html for the streamlit app
Uses the sort-table.js file to sort the tables
Uses the scripts/style.css file to style the tables
Creates a temporary dataframe where all the attributes are converted to clickable links using the make_clickable() function
then converts the dataframe to html and adds the sort-table.js and style.css files to the html
finally writes the html to the streamlit app
make_clickable(link: str, market: bool = False) str[source]#
Parameters:
  • link (str) – link to be made clickable

  • market (bool) – if true makes the text as just “LINK” and connects it to market

Return type:

str

Example:

make_clickable(”https://steamcommunity.com/market/listings/753/746850-Chinatown” )

Returns:

<a target=”_blank” href=”https://steamcommunity.com/market/listings/753/746850-Chinatown”>https://steamcommunity.com/market/listings/753/746850-Chinatown</a>

Takes a link and returns a clickable link