Skip to content

Instantly share code, notes, and snippets.

@Atlas48
Created May 19, 2023 14:01
Show Gist options
  • Save Atlas48/a483994ef65f7e6b9c38a8e67ebe6f99 to your computer and use it in GitHub Desktop.
Save Atlas48/a483994ef65f7e6b9c38a8e67ebe6f99 to your computer and use it in GitHub Desktop.
converts a json config dump from rclone, into the ini format used to store config data
# rc_json2cfg.py v1
# WTFPL v2+ (It's simple enough that you could probably write it yourself.)
# converts a json config dump from rclone, into the ini format used to store config data
from json import load as json_load
try:
with open("rclonecfg.json", 'r') as f:
o=json_load(f)
except FileNotFoundError:
print("rclonecfg.json not found, edit file and try again.")
exit(1)
for kk, vv in o.items():
print("[%s]"%kk)
for k,v in vv.items():
print("%s=%s"%(k,v))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment