CashCtrlAPIClient.mirror_files(root: (str | Path))
Param root: path of the local directory to mirror
Preparation: get list of local_files and remote_files as pd.DataFrame
Delete remote files
to_delete = ~remote_files['path'].isin(local_files['path'])
Delete all remote_files.loc[to_delete, 'id'] on API
remote_files = remote_files.loc[~ to_delete,:]
Sync categories between local_files and remaining remote_files
Upload new or modified files
Probably fetch category list again to ensure newly created categories are present.
to_upload = ~remote_files['path'].isin(local_files['path']) | locally modified later than remote modified
Upload all local_files.loc[to_upload, 'path']
Sketch for CashCtrlAPIClient.mirror_files()
Preparation: get list of local_files and remote_files as pd.DataFrame
Delete remote files
Sync categories between local_files and remaining remote_files
Upload new or modified files