peter-sync
Bidirectional folder sync from the command line. Define folder pairs, save them as JSON, and keep both sides up to date.
Install
pip install peter-sync
From a local checkout:
python -m pip install -e ".[dev]"
Usage
Open the interactive menu:
peter-sync
Or use subcommands:
peter-sync add notes ~/Documents/Notes ~/Dropbox/Notes
peter-sync add code ~/src/app ~/backup/app --exclude node_modules --exclude .git
peter-sync list
peter-sync exclude code
peter-sync exclude code --add dist
peter-sync exclude code --remove .git
peter-sync exclude code --set node_modules dist
peter-sync sync notes
peter-sync sync notes --jobs 8
peter-sync sync
peter-sync watch notes
peter-sync watch --interval 5
peter-sync remove notes
watch is a long-running process. It polls the folders on an interval (default 2 seconds), reloads settings each cycle, and keeps copying or deleting until you press Ctrl+C. Omit the pair name to watch every saved pair.
Settings are stored at ~/.peter-sync/settings.json unless you pass --settings. After a sync, each pair also stores signatures: the size and modification time of files last verified identical. Older settings files without that field still load.
Example settings file:
{
"pairs": [
{
"name": "notes",
"left": "/Users/you/Documents/Notes",
"right": "/Users/you/Dropbox/Notes",
"snapshot": ["todo.md"],
"exclude": ["node_modules", ".git"]
}
]
}
How sync works
- New files are copied to the other folder.
- When both sides have the same file, the newer modification time wins.
- Identical files are left alone.
- A later sync does not re-read a file whose size and modification time match the last verified sync. The first sync still reads those files. Sync compares and copies up to 8 files at a time; pass
--jobs 1to do one file at a time, which is safer on network folders. - If both files differ and have the same mtime, the pair is reported as a conflict and left unchanged.
- Each pair can exclude folders. A bare name such as
node_modulesis skipped anywhere in the tree. A relative path such asbuild/tmpis skipped only at that location. Excluded folders are not copied, updated, or deleted. - After the first sync, deleting a file on one side deletes it on the other. The last file list is stored in the settings JSON.
Publish to PyPI
- Create an API token at https://pypi.org/manage/account/token/
- Build and upload:
python -m pip install build twine
python -m build
python -m twine upload dist/*
Or publish a GitHub Release and use .github/workflows/publish.yml with trusted publishing (or a PYPI_API_TOKEN repository secret).
Develop
python -m pip install -e ".[dev]"
pytest
Metadata
Release files for peter-sync 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 | Provenance | Actions |
|---|---|---|---|---|
| peter_sync-0.1.3.tar.gz | 19.8 kB | Without provenance | Details for peter_sync-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| peter_sync-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for peter_sync-0.1.3-py3-none-any.whl |
Total release size: 36.6 kB
Release files / peter_sync-0.1.3.tar.gz
| Download URL | peter_sync-0.1.3.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
827ded2c13d4fd9e6696a74b6737eae67eb491ccbfe7575f00e2854e3bb5455c
|
|
BLAKE2b-256 checksum How to use checksums |
66e3f18129defb0328e2d324e895a82b7b406b4cc01f7fb932d20a701f6a1e02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / peter_sync-0.1.3-py3-none-any.whl
| Download URL | peter_sync-0.1.3-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c507a6a4e4ddb66056fea00d05a62f4862d9b6208ce3b045c634b3cac0164cc2
|
|
BLAKE2b-256 checksum How to use checksums |
057759bcecf6d889788df832aefd0a44aa1958283b674d8bbd2db278b2aa457a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for peter-sync 0.1.3
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.