Skip to content

Instantly share code, notes, and snippets.

View oguzhari's full-sized avatar
🍊

Oğuzhan Arı oguzhari

🍊
View GitHub Profile
from datetime import datetime
# Kullanıcıları, girdikleri tarih ile adlandıracağız.
current_user = datetime.now().strftime('%H.%M.%S.%f %d-%m-%Y')
# Kullanıcı için log dosyası oluşturuluyor.
def create_user_log_file():
# Kullanıcı için log dosyası oluşturma,
with open(f"log_{current_user}.txt", "w", encoding="utf-8") as f:
import streamlit as st
from utils import *
st.title("CSV İşleme Uygulaması")
uploaded_files = st.file_uploader("CSV Dosyasını Seçiniz", type="csv")
if st.button("Dosyayı Yükle ve Analiz Et"):
create_user_log_file()
if uploaded_files:
save_to_log('INFO', 'Dosya yükleme işlemi başlatıldı.')
import streamlit as st
from utils import *
st.title("CSV İşleme Uygulaması")
uploaded_files = st.file_uploader("CSV Dosyasını Seçiniz", type="csv")
if st.button("Dosyayı Yükle ve Analiz Et"):
create_user_log_file()
if uploaded_files:
save_to_log('INFO', 'Dosya yükleme işlemi başlatıldı.')
def create_cred_file():
cred_str = '{"access_token": "' + st.secrets["access_token"] +\
'", "client_id": "' + st.secrets["client_id"] +\
'", "client_secret": "' + st.secrets["client_secret"] + \
'", "refresh_token": "' + st.secrets["refresh_token"] + \
'", "token_expiry": "' + st.secrets["token_expiry"] + \
'", "token_uri": "' + st.secrets["token_uri"] + \
'", "user_agent": null' + \
', "revoke_uri": "' + st.secrets["revoke_uri"] + \
'", "id_token": null' + \
def save_files():
gauth = GoogleAuth()
create_cred_file()
gauth.LoadCredentialsFile('mycreds.txt')
drive = GoogleDrive(gauth)
folder_name = 'test' # Please set the folder name.
folders = drive.ListFile(
{