Skip to main content

syncgit

Sync python dicts, strings and modules to files in git repository.

NOTE: syncgit calls git using subprocess, setup git so it does not ask for username or password, otherwise you will get a timeout exception.

Installation

python -m pip install syncgit

Documentation

https://syncgit.readthedocs.io/en/latest/

Example

from typing import List

import time

from syncgit import Repo, SyncConfig

# This callback is called when changes are pushed to the repo
def update_callback(repo: Repo, changes: List[SyncConfig]) -> None:
    print(f"Updated to commit {repo.commit_hash}")

    for change in changes:
        print(f"Updated {change.name}")

# Create repo class and import files from repository
rp = Repo("example_repo", "git@github.com:RainingComputers/syncgit-test.git", "main")
rp.set_config([
    SyncConfig("about_alice", "alice.json", "json"),
    SyncConfig("about_bob", "bob.yml"),
    SyncConfig("text", "text_file.txt", "text"),
    SyncConfig("hello_module", "say_hello.py")
])

# Register call back
rp.set_update_callback(update_callback)

# Start sync
rp.start_sync()

# Imported files will be available as attributes on the repo class
# Changes are reflected immediately on these attributes real time
try:
    while True:
        time.sleep(1)
        print(rp.about_alice)
        print(rp.about_bob)
        print(rp.text)
        rp.hello_module.say_hello("Alice")
except KeyboardInterrupt:
    print("Stopping sync")
    rp.stop_sync()

Metadata

Release files for syncgit 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for syncgit 0.4.4
File Size Uploaded Provenance
syncgit-0.4.4.tar.gz 6.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for syncgit 0.4.4
File Interpreter ABI Platform
syncgit-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / syncgit-0.4.4.tar.gz

Download URL syncgit-0.4.4.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aeb31beea731990eba0ea72039b0e62fa78c9bb362b9440a6bd50870011a660b
BLAKE2b-256 checksum
How to use checksums
2660b1e9d7e1afb6eb6d8ebe40721e2583c6d47ca5978c54110b896e71134f89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.8.10

Release files / syncgit-0.4.4-py3-none-any.whl

Download URL syncgit-0.4.4-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3673c2ff0aa3ec34865032feb9d5ecc7abeea25d0d272c5c2a85a98e04e0ece5
BLAKE2b-256 checksum
How to use checksums
9f2f059ede835be78c414f1108a2f88797e4aca581e9e1b658f1f3828f7b85a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.8.10

Security for syncgit 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page