Skip to main content

Small tool to sync package from different machines

Project description


PythonPackageSyncTool is a Python utility to "fix" requirements.txt.

It is used to make manipulation on requirements.txt that is produces by 'pip freeze'

Getting Help


First of all you should install alex_ber_utils (this dependency is used in

pip3 install -U alex_ber_utils


pip3 install -U python-package-sync-tool

cd /opt/anaconda3/lib/python3.7/site-packages/alexber/reqsync/data/

Note: This is Path where you're actually install my utility, it can be different in your machine.

If you use venv it will look something like:

cd /opt/MyProject/venv/Lib/site-packages/alexber/reqsync

Alternatively you can create sctipt file for yourself, named, say,


import as app

if __name__ == "__main__":

Than create file config.yml near your script (see data/config.yml) or provide all parameter using command line argruments. Use ':' in places where you should naturally write '==' (see explanation below).

Parammeters 'source' and 'destination' are required. You should also provide (requirements) file for 'source'.

mutual_exclusion has default value True.

Now, type

python3 -m --add=some_new_package:1.0.0

or if you're using script ( go the directory with the script and type

./ --add=some_new_package:1.0.0

or if you install my tool to Anaconda/Python/venv that has it's bin folder is in the Path you can run

python_package_sync_tool --add=some_new_package:1.0.0

or alternativley

you can run

reqsync --add=some_new_package:1.0.0

This will run quick check whether package is not in remove list. If it is, the utility will fail. You can override this beahivor by supplying --mutual_exclusion=False.

Then, this will add some_new_package with version 1.0.0 to the requirements-dest.txt


Semicolomn and not equal sign is used here due to Python limitaion of usage of equal sign in the value in the command line.

You can specified multiple packages using comma delimiter.

You can specifiy path to your config file using --config_file.

It can be absolute or relative. If you're running using script (, that it can be relative to the directory whether you put your script. If you're running as the module (python3 -m), it can be relative to /opt/anaconda3/lib/python3.7/site-packages/alexber/reqsync/data/ (exact path can be different, see above).

You can supplied multiply packages by using comma:

python3 -m --add=some_new_package:1.0.0,another_new_package:2.0.0

or if you're using script ( go the directory with the script and type

./ --add=some_new_package:1.0.0,another_new_package:2.0.0

Installing from Github

python3 -m pip install -U

Optionally installing tests requirements.

python3 -m pip install -U[tests]

Or explicitly:

wget -O; unzip; rm

And then installing from source (see below).

Installing from source

python3 -m pip install . # only installs "required"
python3 -m pip install .[test] # installs dependencies for tests

From the directory with

python3 test #run all tests


PythonPackageSyncTool requires the following modules.

  • Python 3.7+

  • PyYAML==5.1

  • alex-ber-utils==0.2.5


All notable changes to this project will be documented in this file.



[0.4.3] - 2019-10-17


  • anaconda-navigator and conda-build added to config.yml.

[0.4.2] - 2019-10-16


  • navigator-updater added to config.yml.

[0.4.1] - 2019-05-30


  • Bug fix: adding packages before all existing one works incorrect.
  • Removing alexber.reqsync.utils.parsers. It was fully duplicated by alexber.utils.parsers. So, all usage was change to the latest (part of alex-ber-utils).

[0.3.1] - 2019-05-23


  • Bug fix: adding packages before all existing one works incorrect.


  • Unit test for bug fix that check adding packages before all existing one.
  • More detail assertion to integration tests.
  • Unit-test for non-sorted requirements-src.
  • Unit-test that check run with empty add and empty remvoe.
  • Unit-test that check removing single package.
  • Unit-test that check remove first package in requirements-src.
  • Unit-test that check remove last package in requirements-src.
  • Unit-test that check that empty lines in requirements-src are ignored.
  • Unit-test that check correct usage of file input buffer and file output buffer.

[0.2.11] - 2019-05-22


  • Dependency alex-ber-utils bumped up to 0.2.5.

[0.2.8] - 2019-05-22


  • Dependency alex-ber-utils bumped up to 0.2.4.

[0.2.6] - 2019-05-22


  • Dependency alex-ber-utils bumped up to 0.2.3.

[0.2.5] - 2019-05-22


  • Fixed bug in, incorrect order between VERSION and UploadCommand (no tag was created on upload)
  • Dependency alex-ber-utils bumped up to 0.2.2.

[0.2.4] - 2019-05-22


  • Adding dependency alex-ber-utils 0.2.1 to

[0.2.3] - 2019-05-22


  • Upgrading urllib3, SQLAlchemy, pycrypto dependenies beacause of volnurabilities issues.

[0.2.2] - 2019-05-22


  • Fixing python-package-sync-tool.
  • Creating alias reqsync to python-package-sync-tool.
  • Some minour fixed.

[0.2.1] - 2019-05-22


  • Changing dependency version of alex-ber-utils to 0.2.1.

[0.2.0] - 2019-05-22


  • Only bumping up version.

[0.1.9] - 2019-05-22


  • Added alex-ber-utils as dependency.
  • Deleting old README-old.rst file.
  • requirements-src.txt updated.
  • Clarification added to that alex_ber_utils should be installed first.
  • formatting CHANGELOG.MD (minor fix)
  • Added alternative of usage of python_package_sync_tool to
  • Fixing bug that --add is empty
  • Factor out tests_data to seperate folder, use importlib.resources API.
  • Updated README-old.rst

[0.1.8] - 2019-05-20


  • change, key '-U' added to pip3 install.

[0.1.7] - 2019-05-20


  • Some project cleanup.


  • CHANGELOG and REAMDE now use Markdown format.
  • REAMDE totally rewritten.
  • Fixing bugs in the core algorithm. Simplifying code.
  • Fixing correct handling of package adding to the buttom of the list.

[0.1.6] - 2019-05-20


  • file added to

[0.1.5] - 2019-05-20


  • Small tool to sync package from different machines.

Project details

Download files

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

Files for python-package-sync-tool, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size python_package_sync_tool-0.4.3-py3-none-any.whl (16.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size python_package_sync_tool-0.4.3.tar.gz (11.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page