Set GOOGLE_APPLICATION_CREDENTIALS via the file uploader (to use Google APIs)

Yep, it’s great, thanks again!

Only thing now is that as I’m testing the Google NLP API, I’m absolutely through the roof with my credits!

Not that it’s crazily expensive per token, yet when the script is triggered 100’s of times, it can be a bit costly! :heavy_dollar_sign: :open_mouth:

As a workaround, I’m only scraping short pages and I’ve now implemented several buttons throughout the codebase, such as:

if st.button('Send Request to GCPs NLP API - both URLs'):

… allowing me to break down the process, yet there may be better solutions.

I did try @st.cache(allow_output_mutation=True) on related functions, yet no luck, as it’s throwing the UnhashableTypeError error

Another thing I may need to try (tomorrow, as it’s getting too late now ;)) would be to store the API results into a variable and only pursue my PoC from the results stored in that variable.

I’d certainly be keen to hear about any workaround :slight_smile:

Thanks,
Charly

Hallelujah @okld! It’s working! :raised_hands:

2 Likes

Wow, that’s cool! It seems to be working great! And even aesthetically speaking, I really like the simplicity and the small details such as using number emojis to indicate the different steps in a clear way, or the colored dataframe rows.

:clap:

2 Likes

Thanks for the kind words Synode! It means a lot coming from a Python Wiz like you! :raised_hands:

1 Like

Haha thanks! But the real Wiz are the Streamlit team :wink:

1 Like