SaM Import abgeschlossen

This commit is contained in:
Patrick vom Hagen
2024-02-15 09:04:12 +01:00
parent 6b70b3eb1c
commit 9e66b45645
13 changed files with 540 additions and 40 deletions

View File

@@ -6,7 +6,7 @@ import uuid
# TODO Filter für Spalten, ggfs. Klasse benötigt
# TODO Filter für Dublikate hier wird dann die Klasse benötigt
# TODO Filter für Duplikate hier wird dann die Klasse benötigt
def read_csv(file_path):
@@ -82,7 +82,7 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
new_data.insert(loc=2, column='schuelerid', value=new_uuids)
mailUserQuota = 2048
oxUserQuota = 20480
oxContext = 25
oxContext = 27
print(new_data.columns)
print("New Data:" + str(len(new_data)))
@@ -108,7 +108,7 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
# print(import_df)
# pd.reset_option('display.max_rows')
# pd.reset_option('display.max_columns')
out_path = '../Data/GPS/outputLehrer.csv'
out_path = '../Data/SaM/outputLehrer.csv'
import_df.to_csv(out_path, sep=';', index=False)
print(len(import_df))
print('Lehrer Import Liste erzeugt')
@@ -116,9 +116,9 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
def main():
file1_path = '../Data/GPS/gpsLnew.csv'
file2_path = '../Data/GPS/gpsLold2.cvs'
file3_path = '../Data/GPS/gpsLold.csv'
file1_path = '../Data/SaM/export_lehrer_SaM.csv'
file2_path = '../Data/SaM/sys_lehrer_reduce.csv'
file3_path = '../Data/SaM/sys_lehrer_SaM.csv'
common_pairs, new_pairs, old_pairs, data1, data2 = compare_csv(file1_path, file2_path)

View File

@@ -51,7 +51,7 @@ def create_uuid():
def add_hl_tag(row):
klasse = str(row['klasse']).lstrip('0')
return 'HL0707104-' + klasse
return 'HL0707116-' + klasse
def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
@@ -85,7 +85,7 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
new_data.insert(loc=2, column='schuelerid', value=new_uuids)
mailUserQuota = 1024
oxUserQuota = 5120
oxContext = 25
oxContext = 27
# print(new_data)
print(len(new_data))
@@ -109,7 +109,7 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
# print(import_df)
# pd.reset_option('display.max_rows')
# pd.reset_option('display.max_columns')
out_path = '../Data/GPS/outputSchueler.csv'
out_path = '../Data/SaM/outputSchueler.csv'
import_df.to_csv(out_path, sep=';', index=False)
print(len(import_df))
print('Schüler Import Liste erzeugt')
@@ -117,9 +117,9 @@ def create_import_list(path, path_new, old_pairs, new_pairs, common_pairs):
def main():
file1_path = '../Data/GPS/gpsSnew.csv'
file2_path = '../Data/GPS/gpsSold2.cvs'
file3_path = '../Data/GPS/gpsSold.csv'
file1_path = '../Data/SaM/export_schueler_SaM.csv'
file2_path = '../Data/SaM/sys_schueler_reduce.csv'
file3_path = '../Data/SaM/sys_schueler_SaM.csv'
common_pairs, new_pairs, old_pairs, data1, data2 = compare_csv(file1_path, file2_path)

View File

@@ -4,13 +4,13 @@ if __name__ == "__main__":
oldlist = 'Data/alte-liste-utf.csv'
newlist = 'Data/neue-liste-utf.csv'
test = 'GPS/lehrer_HL0707113.csv_intern'
new_test = 'GPS/gpsLold.csv'
clean = 'GPS/gpsLold2.cvs'
test = '../Data/SaM/export_schueler_202402121132.CSV'
new_test = '../Data/SaM/sys_schueler_SaM.csv'
clean = '../Data/SaM/sys_schueler_reduce.csv'
# Liste nach Fehler prüfen und Zeichen ersetzen
check_file(test)
format_csv(test, new_test)
# check_file(test)
# format_csv(test, new_test)
clean_data(new_test, clean)
# path_old_csv = input('Pfad zur alten Liste eingeben eingeben: ')

12
first_try/names.py Normal file
View File

@@ -0,0 +1,12 @@
import pandas as pd
df = pd.read_csv("../Data/SaM/sus.csv", encoding="utf-8")
df['username'] = df['username;name;vorname;klasse;schuelerid'].str.split(';').str[0]
# Lösche die ursprüngliche Spalte
df.drop(columns=['username;name;vorname;klasse;schuelerid'], inplace=True)
# Ergebnis anzeigen
print("DataFrame mit Benutzernamen:")
print(df)
df.to_csv("../Data/SaM/sus_usernames", index=False, encoding='utf-8')