A Modern way to sync files
Project description
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 skilllink 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(skillList=['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(
skillList=['my_skill', 'other_skill.py'],
override=False,
githubToken=os.getenv('GITHUB_TOKEN'),
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synclink-0.1.1.tar.gz.
File metadata
- Download URL: synclink-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cf88f3205270dbd4334ddda523f7c6a33118561b3d7d57b4cdca219e21c6e36
|
|
| MD5 |
3f47666b60111098405d119340086037
|
|
| BLAKE2b-256 |
67722b3ba662b0015bd9e65e9f0ef139f6de72021a72253b9b506b914813b378
|
File details
Details for the file synclink-0.1.1-py3-none-any.whl.
File metadata
- Download URL: synclink-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17a6347823499346b8a369d143f48304fe6b00beec572c3c82bff83053e94e6d
|
|
| MD5 |
cd6bc684c7c560f0b97ced633c1a6ef5
|
|
| BLAKE2b-256 |
33179d168eec2c3e656c1442f4d74b4980be51285a290db34d89d0a2b5422c3d
|