Local file synchronization for scattered shared libraries
Project description
📖 FSync
This tool eliminates the problem of scattered libraries by synchronizing 🔄 selected files spread across different projects on your machine (locally). No more chaos and manual file copying.
At first glance, centralizing libraries seems like a great idea. It makes work easier and avoids code duplication. In practice, however, some complications arise:
- You don't always want to update a library in a project you're no longer developing, but it still needs to work.
- Some libraries must be part of the repository. When you hand off/close a project, you want everything in one place, without having to pull additional dependencies from external sources.
- It's better when all resources are in the project directory. It simplifies configuration (Makefile, CMake), eliminates path and version issues, and improves IDE integration.
This solution is perfect if you run many smaller projects and care about efficient library management (code that appears across multiple projects). If you make frequent changes, want to avoid messy code, but don't have time to spend hours organizing dependencies: this tool is for you! The program is dead simple. What matters is efficient and effective work, without unnecessary bureaucracy. The open source community can do its thing, but here the priority is a happy client and a working project done ⚡fast and 👍good enough.
🧐 Problems!
- ❌ Possible accidental overwrites: if you edit two versions of a library at the same time.
- ✅ Avoid this, but if it happens, every overwritten version is saved as a timestamped backup, so you can always recover your changes.
- ❌ No environment isolation: different projects may require different versions of the same library.
- ✅ Not a problem! Just create separate entries for different versions, keeping synchronization independent. You can also comment out entries for libraries that shouldn't be updated anymore.
- ❌ Code duplication across repositories: instead of one library copy, you have several in different projects.
- ✅ That's the point! Each client should have their own library version, with no dependencies on other repos. Full control, zero unnecessary complications.
🤔 Alternatives?
Of course you can approach this more professionally by:
- Versioning libraries as separate projects/repositories and updating them as needed.
- Using Git Submodules, which allows tracking library versions in the repository.
- External package managers (
pip,npm,cargo) that simplify dependency management.
If any of our libraries reach a stable version that we don't chaotically change every project, and they're good enough, it's worth considering one of the above solutions.
⚙️ Config
The sync.json file defines file synchronization configuration. Each entry is a key (filename) and a list of paths to synchronize. Keys starting with # are treated as commented out and skipped.
Paths can use shorthand notation via the dict.ini file, which defines aliases for frequently repeated locations. In sync.json paths you can reference these aliases using {key} notation.
Example
Running the program with the -e, --example flag will create example config files locally.
File dict.ini
web = C:/Users/Me/Projects/WebPage/backend
staff = C:/Users/Me/Desktop/MyStaff/test
work = C:/Users/Me/Work/Drivers/repos
File sync.json
{
"serial.c": ["{staff}/serial.c", "{work}/PLC/serial_port.c"],
"utils.py": ["{web}/lib/utils.py", "{work}/PLC/misc.py"],
"#old_lib.c": ["{staff}/old_lib.c", "{work}/legacy/old_lib.c"]
}
📦 Install
pip install fsync # basic
pip install fsync[diff] # + rich (diff display)
Also available as standalone
.exeon GitHub Releases.
🚀 Use
First, set the workspace: the directory containing your config files (sync.json, dict.ini) and where backups will be stored:
fsync -w C:/Projects/sync # specified path
fsync -w # current directory
Running the program generates a report:
fsync
To synchronize (i.e. update older file versions), just add the -u, --update flag:
fsync -u
For each pair of files with discrepancies, tags are generated. You can use them to inspect differences between files with the -d, --diff flag:
fsync -d 1.1
Project details
Release history Release notifications | RSS feed
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 fsync-1.0.0.tar.gz.
File metadata
- Download URL: fsync-1.0.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50bdc4e43ea653accb99b356dcb1a8c1962d3710b83f3e14072e5c3da41f190d
|
|
| MD5 |
439aed402755672c420074cb9f77cb91
|
|
| BLAKE2b-256 |
4ba91e1687e3be3be1e112b2eef6d4b7afe8064afe1f35bf66f415477acbe1f1
|
Provenance
The following attestation bundles were made for fsync-1.0.0.tar.gz:
Publisher:
publish.yml on Xaeian/FSync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fsync-1.0.0.tar.gz -
Subject digest:
50bdc4e43ea653accb99b356dcb1a8c1962d3710b83f3e14072e5c3da41f190d - Sigstore transparency entry: 1117634519
- Sigstore integration time:
-
Permalink:
Xaeian/FSync@e9a4887fb25fcea01552b9a0289a0a3769e5cb16 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Xaeian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9a4887fb25fcea01552b9a0289a0a3769e5cb16 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fsync-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fsync-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e440f7cd3aa553bca3017b8d321be0a1609fc4bf836647891dbba507a666ad9d
|
|
| MD5 |
31f10fa0978a1452a92eb0822c416fbc
|
|
| BLAKE2b-256 |
0b089be2aa4248d1f538185be7adf2d68ad82a8682359f164f845b4bc97ecf69
|
Provenance
The following attestation bundles were made for fsync-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on Xaeian/FSync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fsync-1.0.0-py3-none-any.whl -
Subject digest:
e440f7cd3aa553bca3017b8d321be0a1609fc4bf836647891dbba507a666ad9d - Sigstore transparency entry: 1117634584
- Sigstore integration time:
-
Permalink:
Xaeian/FSync@e9a4887fb25fcea01552b9a0289a0a3769e5cb16 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Xaeian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9a4887fb25fcea01552b9a0289a0a3769e5cb16 -
Trigger Event:
release
-
Statement type: