{"id":16215762,"url":"https://github.com/rainingcomputers/syncgit","last_synced_at":"2025-04-07T22:42:03.013Z","repository":{"id":57472897,"uuid":"376501078","full_name":"RainingComputers/syncgit","owner":"RainingComputers","description":"Sync python dicts, strings and modules to files in git repository.","archived":false,"fork":false,"pushed_at":"2021-10-31T09:19:49.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T06:49:33.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RainingComputers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-13T09:41:02.000Z","updated_at":"2021-10-31T09:19:52.000Z","dependencies_parsed_at":"2022-09-19T10:22:03.890Z","dependency_job_id":null,"html_url":"https://github.com/RainingComputers/syncgit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RainingComputers%2Fsyncgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RainingComputers%2Fsyncgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RainingComputers%2Fsyncgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RainingComputers%2Fsyncgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RainingComputers","download_url":"https://codeload.github.com/RainingComputers/syncgit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744284,"owners_count":20988781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T11:16:19.974Z","updated_at":"2025-04-07T22:42:02.993Z","avatar_url":"https://github.com/RainingComputers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syncgit\n\nSync python dicts, strings and modules to files in git repository.\n\nNOTE: syncgit calls git using subprocess, setup git so it does not ask for username or password,\notherwise you will get a timeout exception.\n\n### Installation\n\n```\npython -m pip install syncgit\n```\n\n### Documentation\n\nhttps://syncgit.readthedocs.io/en/latest/\n\n### Example \n\n```python\nfrom typing import List\n\nimport time\n\nfrom syncgit import Repo, SyncConfig\n\n# This callback is called when changes are pushed to the repo\ndef update_callback(repo: Repo, changes: List[SyncConfig]) -\u003e None:\n    print(f\"Updated to commit {repo.commit_hash}\")\n\n    for change in changes:\n        print(f\"Updated {change.name}\")\n\n# Create repo class and import files from repository\nrp = Repo(\"example_repo\", \"git@github.com:RainingComputers/syncgit-test.git\", \"main\")\nrp.set_config([\n    SyncConfig(\"about_alice\", \"alice.json\", \"json\"),\n    SyncConfig(\"about_bob\", \"bob.yml\"),\n    SyncConfig(\"text\", \"text_file.txt\", \"text\"),\n    SyncConfig(\"hello_module\", \"say_hello.py\")\n])\n\n# Register call back\nrp.set_update_callback(update_callback)\n\n# Start sync\nrp.start_sync()\n\n# Imported files will be available as attributes on the repo class\n# Changes are reflected immediately on these attributes real time\ntry:\n    while True:\n        time.sleep(1)\n        print(rp.about_alice)\n        print(rp.about_bob)\n        print(rp.text)\n        rp.hello_module.say_hello(\"Alice\")\nexcept KeyboardInterrupt:\n    print(\"Stopping sync\")\n    rp.stop_sync()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainingcomputers%2Fsyncgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frainingcomputers%2Fsyncgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainingcomputers%2Fsyncgit/lists"}