From e94a55883da4f4bff170af862b28a76a4f57edce Mon Sep 17 00:00:00 2001 From: Eduard Friske <eduard.friske@ptb.de> Date: Thu, 28 Mar 2024 12:26:50 +0100 Subject: [PATCH] Proof of Concept mit hart codiertem Pfad --- file-to-couchdb_TLA.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/file-to-couchdb_TLA.py b/file-to-couchdb_TLA.py index fa4f7ee..c4909cf 100644 --- a/file-to-couchdb_TLA.py +++ b/file-to-couchdb_TLA.py @@ -14,11 +14,13 @@ import math import statistics import pandas as pd import json -import couchdb +import couchdb +from pathlib import Path +import os +#import pathlib couch = couchdb.Server('http://a73434.berlin.ptb.de:5984') db = couch['vl_db'] # existing - ## Eingabe von: # - Kalibrierscheinnummer # - Jahr der Kalibrierung @@ -26,7 +28,7 @@ db = couch['vl_db'] # existing -cal_cert = "75556" +cal_cert = "75559" year = "2024" no = "0001" @@ -36,13 +38,25 @@ doc = db.get(json_file) # Die Daten aus dem File mit der entsprechenden Kalibrierscheinnummer werden eingelesen: # datum, time, p_up und alle Temperaturen, -path='C:\\Users\\becker07\\python\\TL2\\' -datei = path + cal_cert + "PTB" + year -datei_S = path + cal_cert + "PTB" + year + "_S" +path=Path('/home/friske01/O/Vakuum/Messplaetze/TL2/Messwerte') + +#print(path.exists()) +#datei = path.joinpath(year + ".json") +datei = path.joinpath(cal_cert + "PTB" + year) +#datei = "file://fs.isc.pad.ptb.de/fs/Abt7/Fb75/Vakuum/Messplaetze/TL2/Messwerte/75556PTB2024" +#print(datei, datei.exists(), datei.stat()) +datei_S = path.joinpath(cal_cert + "PTB" + year + "_S") print(json_file) +#exit() + +#with smbclient.open_file(datei, mode= 'r') as datei_handle: datei_pkt = pd.read_csv(datei, sep="\t", decimal = ',' ) +print(datei_pkt) +#with smbclient.open_file(datei_S, mode= 'r') as datei_handle: datei_S_pkt = pd.read_csv(datei_S, sep="\t", decimal = ',' ) +print(datei_S_pkt) +exit() datum=datei_pkt["Datum"] time=datei_pkt["Zeit"] p_up=datei_pkt["Druck"] -- GitLab