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 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: |
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 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ı.') |
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 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ı.') |
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
| 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' + \ |
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
| 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( | |
| { |
OlderNewer