Skip to main content

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 list
peter-sync sync notes
peter-sync sync
peter-sync remove notes

Settings are stored at ~/.peter-sync/settings.json unless you pass --settings.

Example settings file:

{
  "pairs": [
    {
      "name": "notes",
      "left": "/Users/you/Documents/Notes",
      "right": "/Users/you/Dropbox/Notes",
      "snapshot": ["todo.md"]
    }
  ]
}

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.
  • If both files differ and have the same mtime, the pair is reported as a conflict and left unchanged.
  • 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

  1. Create an API token at https://pypi.org/manage/account/token/
  2. 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peter_sync-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peter_sync-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file peter_sync-0.1.0.tar.gz.

File metadata

  • Download URL: peter_sync-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for peter_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5d56ef30af00d06e73d8b3c682f5149bb811763e4ace87aad90ff30677896642
MD5 84589aa29e5cb8c4572e1abb1da32e13
BLAKE2b-256 9f39993695fecba5af658bdc483744dc70602d920d0f9d4380c7f0ef88959dce

See more details on using hashes here.

File details

Details for the file peter_sync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: peter_sync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for peter_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c5fccff653d426d90f605b0d27be8480883fa35ce99fcf1c749bf6c38703004
MD5 153b417175790a40e04e47810fef8cf1
BLAKE2b-256 08bcb3da527b549a703ad44531504fcd6df3dfb6a0f2feece340426b95b84f83

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page