Compare commits
2 Commits
e2805f9af2
...
d872cd7681
Author | SHA1 | Date | |
---|---|---|---|
d872cd7681 | |||
bfebd6b58a |
5
Makefile
5
Makefile
@ -46,4 +46,7 @@ clean_built:
|
|||||||
clean_all: clean_built clean_raw
|
clean_all: clean_built clean_raw
|
||||||
|
|
||||||
import_nextcloud:
|
import_nextcloud:
|
||||||
rsync -a ~/Nextcloud/PLESNA\ Compta\ SYSTEM/Histoire/ ./datas/Histoire
|
rsync -av ~/Nextcloud/PLESNA\ Compta\ SYSTEM/Histoire/ ./datas/Histoire
|
||||||
|
|
||||||
|
push_nextcloud:
|
||||||
|
rsync -av ./datas/datamart/ ~/Nextcloud/PLESNA\ Compta\ SYSTEM/DataMart
|
||||||
|
@ -19,9 +19,6 @@ logger.setLevel(logging.DEBUG)
|
|||||||
|
|
||||||
def build_lots(dfs: list[pd.DataFrame]) -> pd.DataFrame:
|
def build_lots(dfs: list[pd.DataFrame]) -> pd.DataFrame:
|
||||||
df = pd.concat(dfs)
|
df = pd.concat(dfs)
|
||||||
df = df.assign(
|
|
||||||
Impact=df["Crédit"] - df["Débit"],
|
|
||||||
)
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,9 +23,11 @@ def extract_cat(cat: pd.DataFrame):
|
|||||||
|
|
||||||
|
|
||||||
def lot_naming(value):
|
def lot_naming(value):
|
||||||
if str(value).isnumeric():
|
try:
|
||||||
return str(value).zfill(2)
|
v = int(value)
|
||||||
return "PC"
|
except ValueError:
|
||||||
|
return "PC"
|
||||||
|
return str(v).zfill(2)
|
||||||
|
|
||||||
|
|
||||||
def trans_2017_2021(
|
def trans_2017_2021(
|
||||||
@ -99,7 +101,7 @@ def trans_2023(
|
|||||||
df = df.assign(
|
df = df.assign(
|
||||||
Débit=df["Débit"].fillna(0),
|
Débit=df["Débit"].fillna(0),
|
||||||
Crédit=df["Crédit"].fillna(0),
|
Crédit=df["Crédit"].fillna(0),
|
||||||
Lot=lot_naming(df["Porte"]),
|
Lot=df["Porte"].apply(lot_naming),
|
||||||
Année=year,
|
Année=year,
|
||||||
)
|
)
|
||||||
return df[stagging_columns]
|
return df[stagging_columns]
|
||||||
|
Loading…
Reference in New Issue
Block a user