dirsync
Advanced directory tree synchronisation tool
What it is and what it does
dirsync is a command-line and Python library tool for synchronizing directory trees. It can report differences between directories, one-way sync from source to target, or bidirectional updates. The tool supports filtering via regex patterns to include or exclude specific files and directories, and offers options like purging removed files, forcing permission changes, and comparing by content alone or by timestamps.
It runs with zero runtime dependencies and works across operating systems. You can use it from the command line with configuration files for repeated tasks, or call it directly from Python code with a simple API. The package is stable (Production/Stable status) and actively maintained, making it suitable for backup automation, mirror operations, or build system workflows.
Use it for:
- Automate daily backups by syncing a project directory to an external drive with purge enabled
- Mirror a source repository to a target location, updating only changed files to save bandwidth
- Implement a two-way sync between a local working directory and a network share
- Filter and sync only specific file types (e.g., source code, excluding build artifacts) using regex patterns
- Generate a diff report before applying changes to detect what would be added, removed, or modified
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Synchronizes, updates, or reports differences between two directory trees, with support for filtering by regex patterns and bidirectional sync.
Yes. dirsync is a lightweight, actively maintained tool with no dependencies, permissive licensing, and a simple API suitable for directory synchronization tasks. Install it if you need reliable sync, diff, or mirror operations in scripts or applications.
Install
dirsync on PyPI
pip
pip install dirsyncuv
uv add dirsyncpoetry
poetry add dirsyncInstalling dirsync
Before you install
Low install friction with no runtime dependencies. Active maintenance as of 2026-03-23 with a recent release in 2025-05-24.
License in practice
MIT license (permissive) allows free use, modification, and distribution with minimal restrictions.
Quickstart
pip install dirsync
from dirsync import sync
sync('/source/path', '/target/path', 'sync', purge=True)
Verify before relying
- Whether Python 2 support is still actively maintained or tested given the classifier presence
- Performance characteristics with very large directory trees or slow filesystems
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 447 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 196,436/month — #9,786 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dirsync-2.2.6-py3-none-any.whl
Keywords: directory, folder, update, synchronisation
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
vdirsyncerVdirsyncer is a command-line tool that…
permissive · top 15,000 on PyPI
deepdiff6DeepDiff recursively compares two Python…
permissive · top 15,000 on PyPI
sysrsyncWraps the system rsync command for Python,…
unclear · top 15,000 on PyPI
dirsqlWatches a local directory, indexes structured…
permissive · top 15,000 on PyPI
dep-syncSynchronizes Python environments by managing…
unclear · top 15,000 on PyPI
pathspecMatches file paths against gitignore-style…
copyleft · top 100 on PyPI
py-walkFilters filesystem paths using gitignore-style…
permissive · top 5,000 on PyPI
diff-coverCompares test coverage reports against git…
permissive · top 1,000 on PyPI
xmldiffxmldiff compares two XML files or trees and…
permissive · top 15,000 on PyPI
aiosyncthingAsynchronous Python client for the Syncthing…
permissive · top 15,000 on PyPI