This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import Libraries | |
| import os | |
| from supabase import create_client, Client | |
| url: str = os.environ.get("SUPABASE_URL") | |
| key: str = os.environ.get("SUPABASE_KEY") | |
| supabase: Client = create_client(url, key) | |
| # Function to Fetch All Teams |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM amazon/aws-lambda-python:3.8 | |
| ARG FUNCTION_DIR="/var/task/" | |
| COPY ./ ${FUNCTION_DIR} | |
| # Setup Python environment | |
| RUN pip install requirements.txt | |
| # Grab the zappa handler.py and put it in the working directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM public.ecr.aws/lambda/python:3.8 | |
| ARG FUNCTION_DIR="/var/task/" | |
| COPY ./ ${FUNCTION_DIR} | |
| # Install OpenJDK | |
| RUN yum install -y java-1.8.0-openjdk | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import libraries | |
| import json | |
| from flask import request, jsonify,Flask | |
| import pandas as pd | |
| import urllib.request | |
| import PyPDF2 | |
| import io | |
| import time | |
| from tabula.io import read_pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Function to get dataframe from PDF | |
| def pdf_to_df(URL): | |
| ''' | |
| :param URL: | |
| :return: list of dataframes for each page of pdf | |
| ''' | |
| start_time = time.time() | |
| req = urllib.request.Request(url_path, headers={'User-Agent': "Magic Browser"}) | |
| remote_file = urllib.request.urlopen(req).read() | |
| remote_file_bytes = io.BytesIO(remote_file) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| duration = [] | |
| start_time = [] | |
| end_time = [] | |
| dur = [] | |
| c = 0 | |
| for tr in tr_all: | |
| start_time.append([]) | |
| end_time.append([]) | |
| duration.append([]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import streamlit as st | |
| from wordcloud import WordCloud, STOPWORDS | |
| import matplotlib.pyplot as plt | |
| st.set_page_config( | |
| layout='wide') | |
| st.title("Topic Finder") | |
| pytrend_word = st.sidebar.text_input("Google Trend Search Term",google_topic) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| newsapi = NewsApiClient(api_key=news_key) | |
| news_list= [] | |
| def newtrends(keyword): | |
| try: | |
| top_headlines = newsapi.get_everything(q=keyword, | |
| from_param=last_week, | |
| to=today, language='en') | |
| i = 0 |
NewerOlder