It's not an exact match for your current functionality because resticpy returns results as dictionaries (using the --json flag to restic) but restic-PyBM is designed around plaintext stdout results.
If you're interested in switching over, I'd be happy to help.
I created a library that might complement your script:
https://github.com/mtlynch/resticpy
It's a thin wrapper over the restic binary, so it handles all the interactions with restic so that you never have to call
subprocess.run
Here's a rough version of how it looks porting this repo to resticpy:
https://github.com/sephiroth1395/restic-PyBM/compare/main...mtlynch:resticpy?expand=1
It's not an exact match for your current functionality because resticpy returns results as dictionaries (using the
--json
flag to restic) but restic-PyBM is designed around plaintext stdout results.If you're interested in switching over, I'd be happy to help.