Synchronize requirements files to installed versions safely and atomically.
Project description
reqsync
Keep your requirements.txt (and included requirement files) synced to what is actually installed — fast, safe, and low-effort.
Built for the "I just want my requirements file updated" workflow.
What reqsync is
reqsync reads your active environment and rewrites requirement specifiers so files reflect what you're currently running.
- Preserves comments, extras, markers, and line endings.
- Follows
-rincludes. - Skips
-cconstraints unless you opt in. - Uses backups + atomic writes.
What reqsync is not
- Not a lockfile manager.
- Not a dependency solver replacement.
- Not a hash-regenerator for
--hashpinned lines.
Install
pip install reqsync
Optional extras:
pip install "reqsync[mcp]" # built-in MCP server support
pip install "reqsync[pretty]" # optional pretty ecosystem deps
Quick start
# 1) Preview only (no writes)
reqsync run --no-upgrade --dry-run --show-diff
# 2) Apply updates
reqsync run --show-diff
# 3) CI drift gate (fails if changes needed)
reqsync run --check --no-upgrade
Before / after example
# before
requests>=2.30.0
pydantic>=2.5.0
# after (installed env has requests 2.32.3, pydantic 2.7.0)
requests>=2.32.3
pydantic>=2.7.0
Terminal demos
Quick sync preview (--dry-run --show-diff)
CI check mode (--check --no-upgrade)
Integration Guide
Standalone usage
reqsync run --path requirements.txt
reqsync run --path requirements/base.txt --follow-includes
Agentic / MCP usage
# MCP server (stdio)
reqsync mcp
# or dedicated entrypoint
reqsync-mcp
Python API (tool-friendly)
from reqsync.api import run_sync_payload
result = run_sync_payload(
{
"path": "requirements.txt",
"dry_run": True,
"no_upgrade": True,
"show_diff": True,
"policy": "lower-bound",
}
)
print(result["changed"])
print(result["changes"])
Core commands
reqsync run [OPTIONS]
reqsync help [all|run|version|mcp]
reqsync --version
reqsync version
reqsync mcp [--transport stdio|sse|streamable-http]
Most-used options:
--path--no-upgrade--dry-run--check--show-diff--output human|json|both--json-report <file>--backup-keep-last <n>(default5)--policy lower-bound|floor-only|floor-and-cap|update-in-place
Help discoverability:
reqsync help all
reqsync run --help
reqsync mcp --help
Common workflows
# quick local refresh
reqsync run --show-diff
# no network / no pip upgrade
reqsync run --no-upgrade --dry-run --show-diff
# machine output for tools/models
reqsync run --no-upgrade --dry-run --output json
# update constraints too
reqsync run --path requirements/base.txt --update-constraints
Output shape (for models/tools)
--output json or Python API returns structured keys:
changedfiles(withrole,changed,change_count)changes(file,package,installed_version,old_line,new_line)backup_pathsdiff
Safety model
- Blocks outside virtualenv unless
--system-ok. - Blocks hash-pinned files unless
--allow-hashes. - Optional dirty-repo guard via
--allow-dirty. - Lock + backup + atomic write for safer file operations.
- Timestamped backups are auto-pruned (keep latest 5 per file by default).
Docs
Author & Links
Created by: Roy Dawson IV
GitHub: https://github.com/imyourboyroy
PyPi: https://pypi.org/user/ImYourBoyRoy/
Project repo: https://github.com/ImYourBoyRoy/reqsync
License
MIT — see LICENSE.
Project details
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 reqsync-0.1.5.tar.gz.
File metadata
- Download URL: reqsync-0.1.5.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05320ac484ec746382c1115dafcc6169fb2a170cd5a5eebf6b2cdf189308493d
|
|
| MD5 |
8a8a29a023649553b6738a19de62af42
|
|
| BLAKE2b-256 |
dcc798b3dbaae2fa90bf9be739bdd119ab8e6bcd3e9e38c1bc81b6f87c137828
|
Provenance
The following attestation bundles were made for reqsync-0.1.5.tar.gz:
Publisher:
publish.yml on ImYourBoyRoy/reqsync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reqsync-0.1.5.tar.gz -
Subject digest:
05320ac484ec746382c1115dafcc6169fb2a170cd5a5eebf6b2cdf189308493d - Sigstore transparency entry: 979359183
- Sigstore integration time:
-
Permalink:
ImYourBoyRoy/reqsync@fae899a2655b85f56f6ce1673e7c93bfc2d824e3 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ImYourBoyRoy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fae899a2655b85f56f6ce1673e7c93bfc2d824e3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file reqsync-0.1.5-py3-none-any.whl.
File metadata
- Download URL: reqsync-0.1.5-py3-none-any.whl
- Upload date:
- Size: 27.2 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 |
b9780f49eb63024e353af5df78d554747dd413640deed02d95e4b32451535a48
|
|
| MD5 |
361d6a3ea4d86c5ff65ad5a1d7966a03
|
|
| BLAKE2b-256 |
6a8c4624c124bb7cf65119c64ed6d82c93355e8f395fdf7e2afb640c36d38086
|
Provenance
The following attestation bundles were made for reqsync-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on ImYourBoyRoy/reqsync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reqsync-0.1.5-py3-none-any.whl -
Subject digest:
b9780f49eb63024e353af5df78d554747dd413640deed02d95e4b32451535a48 - Sigstore transparency entry: 979359311
- Sigstore integration time:
-
Permalink:
ImYourBoyRoy/reqsync@fae899a2655b85f56f6ce1673e7c93bfc2d824e3 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ImYourBoyRoy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fae899a2655b85f56f6ce1673e7c93bfc2d824e3 -
Trigger Event:
push
-
Statement type: