App for searching the arxiv & it checks for valid Github links!

Just published a small streamlit app for searching the arxiv & it checks for valid Github links! :hugs:

Try: https://robmarkcole-streamlit-arxiv-app-l1541k.streamlit.app/

Code: GitHub - robmarkcole/streamlit-arxiv: Streamlit app for querying the arxiv api

3 Likes

Hi @robmarkcole. Nice app! I think it would be cool if the wide view was forced. The table would look better as a result?

Hi @TomJohn I agree that looks better! I was also hoping to make the url’s clickable, but despite experimentation, was not able to achieve that. Would you recommend making these changes in streamlit, or are there external plugins which would be suitable? Thanks!

1 Like

As for wide layout it is quite simple: st.set_page_config - Streamlit Docs

Regarding clickable links: maybe this will help?

Thanks I just implemented with wide table :grinning:

Re that thread I tried the suggestions without success. Bit frustrating that the thread was then closed

1 Like

As this (i.e. links in a table) is a thing that I would like to able to do I will look into it in the evening :slight_smile: have a great day!

1 Like

@robmarkcole ,

I already found some useful articles with your app. Sure I could use their native search but more fun this way. So many possibilities to extend it…

Thanks.

2 Likes

The app has lots of scope for improvement, particularly making the search more fully featured (multiple queries, on category etc). Another idea is that in addition to github url, to find url for popular dataset locations like Zenodo.

@robmarkcole after some reasearch I see that it currently not possible to show links in st.dataframe, here is a link to github issue: Display clickable links in st.dataframe or st.table · Issue #983 · streamlit/streamlit · GitHub it is in open status.

As for workarounds it seems that there three options:

  1. Use static table
  2. Use plotly
  3. Use AgGrid

all of above discussed here: How to display a clickable link pandas dataframe - #2 by mathcatsand

Just trying ag-grid, perhaps some special args are required but out of the box the links are not clickable

Same for st.table

Yes, for AdGrid it requries some JS in cellRenderer How to display a clickable link pandas dataframe - #5 by edsaac

import streamlit as st
import pandas as pd
from st_aggrid import AgGrid, JsCode, GridOptionsBuilder

df = pd.DataFrame(
    {
        "Site": "DuckDuckGo Google Bing".split(),
        "URL": "https://duckduckgo.com/ https://www.google.com/ https://www.bing.com/".split(),
    }
)

gb = GridOptionsBuilder.from_dataframe(df)

gb.configure_column(
    "URL",
    headerName="URL",
    cellRenderer=JsCode(
        """
                        function(params) {
                            return '<a href=' + params.value + ' target="_blank"> 🖱️ </a>'
                            }
                        """
    ),
)

gridOptions = gb.build()

AgGrid(df, gridOptions=gridOptions, allow_unsafe_jscode=True)
1 Like

That approach does work, although it is not displaying the url which is a bit confusing

image

if you replace return line to:

return '<a href=' + params.value + ' target="_blank">'+ params.value +'</a>'

it will work :slight_smile:

image

2 Likes

Thanks, the result is very nice!

1 Like

Btw. @robmarkcole you may consider custom subdomain for your app Deploy an app - Streamlit Docs

1 Like

Nice suggestion! Will the old url redirect?

Unfortunately, no.

I did make a feature request about redirecting renamed apps a while back if anyone is interested in voting on that. It’s something that pops up on the forum from time to time, but doesn’t seem to have any traction as a feature request yet. :slight_smile:

1 Like

I have renamed the repo and tried to select the below name, but for some reason it is not available, despite there being no app with this name:

image

For some reason custom domain settings page really does not like “hub” in app name :slight_smile: Anyone knows why? :slight_smile: