Upload 4 files
Browse files- Google.py +68 -0
- Home.py +23 -0
- packages.txt +1 -0
- requirements.txt +252 -0
Google.py
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pickle
|
2 |
+
import os
|
3 |
+
from google_auth_oauthlib.flow import Flow, InstalledAppFlow
|
4 |
+
from googleapiclient.discovery import build
|
5 |
+
from googleapiclient.http import MediaFileUpload, MediaIoBaseDownload
|
6 |
+
from google.auth.transport.requests import Request
|
7 |
+
from google.oauth2.credentials import Credentials
|
8 |
+
from googleapiclient.errors import HttpError
|
9 |
+
import streamlit as st
|
10 |
+
|
11 |
+
def Create_Service(client_secret_file, api_name, api_version, *scopes):
|
12 |
+
print(client_secret_file, api_name, api_version, scopes, sep='-')
|
13 |
+
CLIENT_SECRET_FILE = client_secret_file
|
14 |
+
API_SERVICE_NAME = api_name
|
15 |
+
API_VERSION = api_version
|
16 |
+
SCOPES = [scope for scope in scopes[0]]
|
17 |
+
print(SCOPES)
|
18 |
+
|
19 |
+
cred = None
|
20 |
+
|
21 |
+
# pickle_file = f'token_{API_VERSION}.pickle'
|
22 |
+
# print(pickle_file)
|
23 |
+
# if os.path.exists(pickle_file):
|
24 |
+
# with open(pickle_file, 'rb') as token:
|
25 |
+
# cred = pickle.load(token)
|
26 |
+
|
27 |
+
# if os.path.exists("token.json"):
|
28 |
+
# cred = Credentials.from_authorized_user_file("token.json", SCOPES)
|
29 |
+
client_id = st.secrets["AuthToken"]["client_id"]
|
30 |
+
client_secret = st.secrets["AuthToken"]["client_secret"]
|
31 |
+
refresh_token = st.secrets["AuthToken"]["refresh_token"]
|
32 |
+
token_uri = "https://oauth2.googleapis.com/token" # Default token URI for Google
|
33 |
+
|
34 |
+
# Create a Credentials object
|
35 |
+
cred = Credentials.from_authorized_user_info({
|
36 |
+
"client_id": client_id,
|
37 |
+
"client_secret": client_secret,
|
38 |
+
"refresh_token": refresh_token,
|
39 |
+
"token_uri": token_uri
|
40 |
+
}, SCOPES)
|
41 |
+
|
42 |
+
|
43 |
+
if not cred or not cred.valid:
|
44 |
+
if cred and cred.expired and cred.refresh_token:
|
45 |
+
cred.refresh(Request())
|
46 |
+
print("token refreshed")
|
47 |
+
else:
|
48 |
+
flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRET_FILE, SCOPES)
|
49 |
+
cred = flow.run_local_server()
|
50 |
+
print("token recreated")
|
51 |
+
# cred1 = flow.redirect_uri()
|
52 |
+
|
53 |
+
# with open(pickle_file, 'wb') as token:
|
54 |
+
# pickle.dump(cred, token)
|
55 |
+
with open("token.json", "w") as token:
|
56 |
+
token.write(cred.to_json())
|
57 |
+
try:
|
58 |
+
service = build(API_SERVICE_NAME, API_VERSION, credentials=cred)
|
59 |
+
print(API_SERVICE_NAME, 'Cred valid. Service created successfully')
|
60 |
+
return service
|
61 |
+
except Exception as e:
|
62 |
+
print('Unable to connect.')
|
63 |
+
print(e)
|
64 |
+
return None
|
65 |
+
|
66 |
+
# def convert_to_RFC_datetime(year=1900, month=1, day=1, hour=0, minute=0):
|
67 |
+
# dt = datetime.datetime(year, month, day, hour, minute, 0).isoformat() + 'Z'
|
68 |
+
# return dt
|
Home.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
st.set_page_config(
|
4 |
+
page_title="FullstackGPT Home",
|
5 |
+
page_icon="🤖",
|
6 |
+
)
|
7 |
+
|
8 |
+
st.markdown(
|
9 |
+
"""
|
10 |
+
# Welcome to QUUS AI projects!
|
11 |
+
|
12 |
+
Here are the apps we proudly present:
|
13 |
+
|
14 |
+
- [x] [📃 Document AI](/DocumentAI)
|
15 |
+
- [x] [🔒 Local AI](/LocalAI)
|
16 |
+
- [x] [❓ Quiz AI](/QuizAI)
|
17 |
+
- [x] [🖥️ Crawling AI](/CrawlingAI_)
|
18 |
+
- [x] [🖥️ Crawling AI for Moyo](/CrawlingAI_for_Moyo)
|
19 |
+
- [x] [💼 Meeting AI](/MeetingAI)
|
20 |
+
- [x] [📈 Investor AI](/InvestorAI)
|
21 |
+
- [x] [📈 Nokcci AI](/Nokcci)
|
22 |
+
"""
|
23 |
+
)
|
packages.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
chromium
|
requirements.txt
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
aiohttp==3.8.5
|
3 |
+
aiosignal==1.3.1
|
4 |
+
altair==5.1.1
|
5 |
+
annotated-types==0.5.0
|
6 |
+
antlr4-python3-runtime==4.9.3
|
7 |
+
anyio==3.7.1
|
8 |
+
appnope==0.1.3
|
9 |
+
asttokens==2.4.0
|
10 |
+
async-timeout==4.0.3
|
11 |
+
attrs==23.1.0
|
12 |
+
backcall==0.2.0
|
13 |
+
backoff==2.2.1
|
14 |
+
bcrypt==4.0.1
|
15 |
+
beautifulsoup4==4.12.2
|
16 |
+
black==23.9.1
|
17 |
+
blinker==1.6.2
|
18 |
+
blis==0.7.10
|
19 |
+
Brotli==1.1.0
|
20 |
+
cachetools==5.3.1
|
21 |
+
catalogue==2.0.9
|
22 |
+
certifi==2023.7.22
|
23 |
+
cffi==1.15.1
|
24 |
+
chardet==5.2.0
|
25 |
+
charset-normalizer==3.2.0
|
26 |
+
chroma-hnswlib==0.7.3
|
27 |
+
chromadb==0.4.11
|
28 |
+
click==8.1.7
|
29 |
+
coloredlogs==15.0.1
|
30 |
+
comm==0.1.4
|
31 |
+
confection==0.1.3
|
32 |
+
contourpy==1.1.1
|
33 |
+
cryptography==41.0.4
|
34 |
+
cycler==0.11.0
|
35 |
+
cymem==2.0.8
|
36 |
+
dataclasses-json==0.5.14
|
37 |
+
debugpy==1.8.0
|
38 |
+
decorator==5.1.1
|
39 |
+
dill==0.3.7
|
40 |
+
dnspython==2.4.2
|
41 |
+
duckduckgo-search==3.8.5
|
42 |
+
EbookLib==0.18
|
43 |
+
effdet==0.4.1
|
44 |
+
elastic-transport==8.4.0
|
45 |
+
elasticsearch==8.9.0
|
46 |
+
email-validator==2.0.0.post2
|
47 |
+
emoji==2.8.0
|
48 |
+
et-xmlfile==1.1.0
|
49 |
+
executing==1.2.0
|
50 |
+
faiss-cpu==1.7.4
|
51 |
+
fastapi==0.99.1
|
52 |
+
ffmpeg==1.4
|
53 |
+
ffmpeg-python==0.2.0
|
54 |
+
filelock==3.12.4
|
55 |
+
filetype==1.2.0
|
56 |
+
flatbuffers==23.5.26
|
57 |
+
fonttools==4.42.1
|
58 |
+
frozenlist==1.4.0
|
59 |
+
fsspec==2023.9.1
|
60 |
+
future==0.18.3
|
61 |
+
gitdb==4.0.10
|
62 |
+
GitPython==3.1.35
|
63 |
+
gpt4all==2.0.2
|
64 |
+
greenlet==3.0.0
|
65 |
+
h11==0.14.0
|
66 |
+
h2==4.1.0
|
67 |
+
hpack==4.0.0
|
68 |
+
html2text==2020.1.16
|
69 |
+
httpcore==0.18.0
|
70 |
+
httptools==0.6.0
|
71 |
+
httpx==0.25.0
|
72 |
+
huggingface-hub==0.16.4
|
73 |
+
humanfriendly==10.0
|
74 |
+
hyperframe==6.0.1
|
75 |
+
idna==3.4
|
76 |
+
importlib-metadata==6.8.0
|
77 |
+
importlib-resources==6.0.1
|
78 |
+
iopath==0.1.10
|
79 |
+
ipykernel==6.25.2
|
80 |
+
ipython==8.15.0
|
81 |
+
itsdangerous==2.1.2
|
82 |
+
jedi==0.19.0
|
83 |
+
Jinja2==3.1.2
|
84 |
+
joblib==1.3.2
|
85 |
+
jsonpatch==1.33
|
86 |
+
jsonpointer==2.4
|
87 |
+
jsonschema==4.19.0
|
88 |
+
jsonschema-specifications==2023.7.1
|
89 |
+
jupyter_client==8.3.1
|
90 |
+
jupyter_core==5.3.1
|
91 |
+
kiwisolver==1.4.5
|
92 |
+
langchain==0.0.332
|
93 |
+
langcodes==3.3.0
|
94 |
+
langsmith==0.0.52
|
95 |
+
layoutparser==0.3.4
|
96 |
+
loguru==0.7.2
|
97 |
+
lxml==4.9.3
|
98 |
+
manifest-ml==0.0.1
|
99 |
+
Markdown==3.4.4
|
100 |
+
markdown-it-py==3.0.0
|
101 |
+
MarkupSafe==2.1.3
|
102 |
+
marshmallow==3.20.1
|
103 |
+
matplotlib==3.8.0
|
104 |
+
matplotlib-inline==0.1.6
|
105 |
+
mdurl==0.1.2
|
106 |
+
monotonic==1.6
|
107 |
+
mpmath==1.3.0
|
108 |
+
msg-parser==1.2.0
|
109 |
+
multidict==6.0.4
|
110 |
+
murmurhash==1.0.10
|
111 |
+
mypy-extensions==1.0.0
|
112 |
+
nest-asyncio==1.5.8
|
113 |
+
networkx==3.1
|
114 |
+
nltk==3.8.1
|
115 |
+
numexpr==2.8.5
|
116 |
+
numpy==1.25.2
|
117 |
+
olefile==0.46
|
118 |
+
omegaconf==2.3.0
|
119 |
+
onnx==1.14.1
|
120 |
+
onnxruntime==1.16.0
|
121 |
+
openai==0.28.0
|
122 |
+
opencv-python==4.8.0.76
|
123 |
+
openpyxl==3.1.2
|
124 |
+
orjson==3.9.9
|
125 |
+
overrides==7.4.0
|
126 |
+
packaging==23.1
|
127 |
+
pandas>=1.3.0,<2.0.0
|
128 |
+
parso==0.8.3
|
129 |
+
pathspec==0.11.2
|
130 |
+
pathy==0.10.2
|
131 |
+
pdf2image==1.16.3
|
132 |
+
pdfminer.six==20221105
|
133 |
+
pdfplumber==0.10.2
|
134 |
+
pexpect==4.8.0
|
135 |
+
pickleshare==0.7.5
|
136 |
+
Pillow==9.5.0
|
137 |
+
pinecone-client==2.2.4
|
138 |
+
platformdirs==3.10.0
|
139 |
+
playwright==1.39.0
|
140 |
+
portalocker==2.8.2
|
141 |
+
posthog==3.0.2
|
142 |
+
preshed==3.0.9
|
143 |
+
prompt-toolkit==3.0.39
|
144 |
+
protobuf==4.24.3
|
145 |
+
psutil==5.9.5
|
146 |
+
ptyprocess==0.7.0
|
147 |
+
pulsar-client==3.3.0
|
148 |
+
pure-eval==0.2.2
|
149 |
+
pyarrow==13.0.0
|
150 |
+
pycocotools==2.0.7
|
151 |
+
pycparser==2.21
|
152 |
+
pydantic==1.10.12
|
153 |
+
pydantic_core==2.6.3
|
154 |
+
pydeck==0.8.0
|
155 |
+
pydub==0.25.1
|
156 |
+
pyee==11.0.1
|
157 |
+
Pygments==2.16.1
|
158 |
+
Pympler==1.0.1
|
159 |
+
pypandoc==1.11
|
160 |
+
pyparsing==3.1.1
|
161 |
+
pypdf==3.16.2
|
162 |
+
pypdfium2==4.20.0
|
163 |
+
PyPika==0.48.9
|
164 |
+
pytesseract==0.3.10
|
165 |
+
python-dateutil==2.8.2
|
166 |
+
python-docx==0.8.11
|
167 |
+
python-dotenv==1.0.0
|
168 |
+
python-iso639==2023.6.15
|
169 |
+
python-magic==0.4.27
|
170 |
+
python-multipart==0.0.6
|
171 |
+
python-pptx==0.6.21
|
172 |
+
pytube==11.0.2
|
173 |
+
pytz==2023.3.post1
|
174 |
+
pytz-deprecation-shim==0.1.0.post0
|
175 |
+
PyYAML==6.0.1
|
176 |
+
pyzmq==25.1.1
|
177 |
+
rapidfuzz==3.3.1
|
178 |
+
redis==5.0.0
|
179 |
+
referencing==0.30.2
|
180 |
+
regex==2023.8.8
|
181 |
+
requests==2.31.0
|
182 |
+
rich==13.5.2
|
183 |
+
rpds-py==0.10.2
|
184 |
+
safetensors==0.3.3
|
185 |
+
scikit-learn==1.3.1
|
186 |
+
scipy==1.11.3
|
187 |
+
sentence-transformers==2.2.2
|
188 |
+
sentencepiece==0.1.99
|
189 |
+
six==1.16.0
|
190 |
+
smart-open==6.4.0
|
191 |
+
smmap==5.0.0
|
192 |
+
sniffio==1.3.0
|
193 |
+
socksio==1.0.0
|
194 |
+
soupsieve==2.5
|
195 |
+
spacy==3.6.1
|
196 |
+
spacy-legacy==3.0.12
|
197 |
+
spacy-loggers==1.0.5
|
198 |
+
SQLAlchemy==2.0.22
|
199 |
+
sqlitedict==2.1.0
|
200 |
+
srsly==2.4.7
|
201 |
+
stack-data==0.6.2
|
202 |
+
starlette==0.27.0
|
203 |
+
streamlit==1.27.2
|
204 |
+
sympy==1.12
|
205 |
+
tabulate==0.9.0
|
206 |
+
tenacity==8.2.3
|
207 |
+
thinc==8.1.12
|
208 |
+
threadpoolctl==3.2.0
|
209 |
+
tiktoken==0.5.1
|
210 |
+
timm==0.9.7
|
211 |
+
tokenizers==0.14.0
|
212 |
+
toml==0.10.2
|
213 |
+
toolz==0.12.0
|
214 |
+
torch==2.0.1
|
215 |
+
torchvision==0.15.2
|
216 |
+
tornado==6.3.3
|
217 |
+
tqdm==4.66.1
|
218 |
+
traitlets==5.10.0
|
219 |
+
transformers==4.34.0
|
220 |
+
typer==0.9.0
|
221 |
+
typing-inspect==0.9.0
|
222 |
+
typing_extensions==4.7.1
|
223 |
+
tzdata==2023.3
|
224 |
+
tzlocal==4.3.1
|
225 |
+
ujson==5.8.0
|
226 |
+
unstructured==0.10.16
|
227 |
+
unstructured-inference==0.6.6
|
228 |
+
unstructured.pytesseract==0.3.12
|
229 |
+
urllib3==1.26.16
|
230 |
+
uvicorn==0.23.2
|
231 |
+
validators==0.22.0
|
232 |
+
wasabi==1.1.2
|
233 |
+
watchdog==3.0.0
|
234 |
+
watchfiles==0.20.0
|
235 |
+
wcwidth==0.2.6
|
236 |
+
websockets==11.0.3
|
237 |
+
wikipedia==1.4.0
|
238 |
+
xlrd==2.0.1
|
239 |
+
XlsxWriter==3.1.5
|
240 |
+
yarl==1.9.2
|
241 |
+
zipp==3.16.2
|
242 |
+
selenium
|
243 |
+
seleniumbase
|
244 |
+
webdriver-manager
|
245 |
+
streamlit-extras
|
246 |
+
st-gsheets-connection
|
247 |
+
google-api-python-client
|
248 |
+
google-auth-httplib2
|
249 |
+
google-auth-oauthlib
|
250 |
+
google
|
251 |
+
ratelimit
|
252 |
+
pytz
|