SyncLink
SyncLink is a flexible Python utility for syncing code files (skills, scripts, or any directory content) from a folder in a GitHub repository to your local directory. Supports public and private repos, selective file syncing, local-over-remote file protection, and easy integration.
Features
- Sync entire folders or select specific files.
- Skip or override existing local files.
- Supports private repos (via GitHub token).
- Branch selection—sync from any branch, not just master/main.
- Simple, readable code—ready to drop into any project.
- Preserves your local changes by default.
Installation
Simply copy SyncLink into your project, or package as you like.
Dependencies:
- Python 3.10+
requests
Usage
1. Basic Example (Sync All Files)
from SyncLink import SyncLink
syncer = SyncLink(
githubRepo='TristanMcBrideSr/SkillForge',
repoFolder='SkillForge',
syncDir='./skills'
)
syncer.startSync()
2. Sync Only Specific Files
syncer = SyncLink(
githubRepo='your-username/your-repo',
repoFolder='MySkills',
syncDir='./skills'
)
# Only sync 'weather.py' and 'research.py'
syncer.startSync(syncList=['weather', 'research'])
3. Override Existing Local Files
syncer = SyncLink(
githubRepo='TristanMcBrideSr/SkillForge',
repoFolder='SkillForge',
syncDir='./skills'
)
# Force override any local file with the downloaded version
syncer.startSync(override=True)
4. Sync From a Private Repo
syncer = SyncLink(
githubRepo='your-username/private-repo',
repoFolder='MySkills',
syncDir='./skills'
)
# Provide a GitHub token (classic or fine-grained with repo read access)
syncer.startSync(githubToken='YOUR_GITHUB_TOKEN')
5. Sync From a Different Branch
syncer = SyncLink(
githubRepo='TristanMcBrideSr/SkillForge',
repoFolder='SkillForge',
syncDir='./skills'
)
syncer.startSync(branch='dev') # Sync from 'dev' branch
Parameters
SyncLink constructor
- githubRepo: GitHub repo in the form
"owner/repo"(required) - repoFolder: Folder inside the repo to sync from (required)
- syncDir: Local directory to sync files to (required)
startSync(**kwargs)
- skillList (
list): Only these files will be synced (by name,.pyoptional). - override (
bool): IfTrue, always overwrite existing local files. - githubToken (
str): Personal GitHub token for private repo access. - branch (
str): Branch to sync from (default"master").
How It Works
-
Downloads a zip of the specified repo+branch.
-
Extracts just the folder you specify.
-
Copies each file:
- By default: only new files are copied (existing files are untouched).
- With
override=True: always overwrites local files.
-
Lets you pick which files to sync, or sync all.
Error Handling
- Raises if folders/files are missing.
- Logs sync actions and errors to Python logger.
- Skips files that already exist locally, unless
overrideis set.
Example: Complete Workflow
syncer = SyncLink(
githubRepo='my-org/myrepo',
repoFolder='skills',
syncDir='./skills'
)
syncer.startSync(
syncList=['my_skill', 'other_skill.py'],
override=False,
githubToken=os.getenv('GITHUB_TOKEN'), # If syncing from a private repo else you can omit this
branch='main'
)
Code Examples
You can find code examples on my GitHub repository.
License
This project is licensed under the Apache License, Version 2.0. Copyright 2025 Tristan McBride Sr.
Acknowledgements
Project by:
- Tristan McBride Sr.
- Sybil
Release files for SyncLink 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| synclink-0.1.3.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| synclink-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / synclink-0.1.3.tar.gz
| Download URL | synclink-0.1.3.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d2d527f8924e1c0614f01fbbb636e9730b37d96c12d3fa20cfc10220fd047c4
|
|
BLAKE2b-256 checksum How to use checksums |
d2ecf6f63a8493ddac7dbedcba12073b45fa1db1f89417a75a7bd3766b67db2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / synclink-0.1.3-py3-none-any.whl
| Download URL | synclink-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89c14a2d39b731710cc2e4cd3757fe93302699e8883eec78b5346f06788d801c
|
|
BLAKE2b-256 checksum How to use checksums |
4bb2c51f6e0ad3f9aff8686950a5543e933d173d2c2f8199c4f3cfea673c7e45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|