Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Securely copy files to multiple destinations using source and destination verification.

Project description


PyPI version PyPI version GitHub license Code style: black codecov

A multi destination copy tool / library with source and destination verification using xxHash.

Installation / Update

With pip

If you have Python 3 installed you can just use pip:

pip3 install -U ocopy





import tempfile
from pathlib import Path
from time import sleep

from ocopy.copy import CopyJob

def simple_example():
    # For the sake of this example we will create temporary directory.
    # You will not be doing this in your code.
    with tempfile.TemporaryDirectory() as tmp:
        tmp = Path(tmp)

        # Define source and destination directories
        source = tmp / "source"
        destinations = [tmp / "destination_1", tmp / "destination_2", tmp / "destination_3"]

        # Create some test content
        source.mkdir(parents=True, exist_ok=True)
        (source / "testfile").write_text("Some test content")

        # Create the copy job and wait until it is finished
        job = CopyJob(source, destinations, overwrite=True, verify=True)
        while job.finished is not True:

        # Print errors
        for error in job.errors:
            print(f"Failed to copy {}:\n{error.error_message}")

        # Show content of the mhl file
        mhl_file_content = list(destinations[0].glob("**/*.mhl"))[0].read_text()

if __name__ == "__main__":

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 ocopy, version 0.7.1
Filename, size File type Python version Upload date Hashes
Filename, size ocopy-0.7.1.tar.gz (29.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page