Metadata-Version: 2.4
Name: peter-sync
Version: 0.1.0
Summary: Bidirectional folder sync with a simple CLI menu
Author: Peter
License: MIT
Project-URL: Homepage, https://pypi.org/project/peter-sync/
Keywords: sync,folders,bidirectional,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Archiving :: Backup
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# peter-sync

Bidirectional folder sync from the command line. Define folder pairs, save them as JSON, and keep both sides up to date.

## Install

```bash
pip install peter-sync
```

From a local checkout:

```bash
python -m pip install -e ".[dev]"
```

## Usage

Open the interactive menu:

```bash
peter-sync
```

Or use subcommands:

```bash
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:

```json
{
  "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:

```bash
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

```bash
python -m pip install -e ".[dev]"
pytest
```
