Securely copy files to multiple destinations using source and destination verification.
Project description
o/COPY
A multi destination copy tool / library with source and destination verification using xxHash.
Installation / Update
With pip
If you have Python 3.10 or newer installed you can just use pip:
pip3 install -U ocopy
Development
This project uses uv for dependency management, Ruff for linting and formatting, and ty for type checking.
# Create the virtual environment and install runtime + dev dependencies
uv sync
# Run tests
uv run pytest
# Lint, format, and type check
uv run ruff check .
uv run ruff format .
uv run ty check
Usage
CLI
Python
import tempfile
from pathlib import Path
from time import sleep
from ocopy.verified_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:
sleep(0.1)
# Print errors
for error in job.errors:
print(f"Failed to copy {error.source.name}:\n{error.error_message}")
# Show content of the mhl file
mhl_file_content = list(destinations[0].glob("**/*.mhl"))[0].read_text()
print(mhl_file_content)
if __name__ == "__main__":
simple_example()
Project details
Release history Release notifications | RSS feed
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 ocopy-0.7.4.tar.gz.
File metadata
- Download URL: ocopy-0.7.4.tar.gz
- Upload date:
- Size: 80.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a482ba641593912b565c91b6f95b0d31fa6eff35e0cabb9ea708373ee978f7d9
|
|
| MD5 |
63e52c9d2c6c51ca52f2068f14add706
|
|
| BLAKE2b-256 |
633ad9d788798fc6f6165bc378667ca785df186c4232fab07cf2bdd321a15894
|
Provenance
The following attestation bundles were made for ocopy-0.7.4.tar.gz:
Publisher:
release.yml on ottomatic-io/ocopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocopy-0.7.4.tar.gz -
Subject digest:
a482ba641593912b565c91b6f95b0d31fa6eff35e0cabb9ea708373ee978f7d9 - Sigstore transparency entry: 1328155726
- Sigstore integration time:
-
Permalink:
ottomatic-io/ocopy@ceaf7e23b8734181c4aa7267daaf4675dc57f7a7 -
Branch / Tag:
refs/tags/0.7.4 - Owner: https://github.com/ottomatic-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceaf7e23b8734181c4aa7267daaf4675dc57f7a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ocopy-0.7.4-py3-none-any.whl.
File metadata
- Download URL: ocopy-0.7.4-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5c2795dba949f63cb3d697fa336fb0c33473bc62f83f8491d578b74ddfa4e21
|
|
| MD5 |
f44f3a0f3204f15dac7fa6f81a69c72a
|
|
| BLAKE2b-256 |
c8fe31cb32c309e21272e97bbb7269ffe3291a06a09de08d3a6dfa2e258a81a1
|
Provenance
The following attestation bundles were made for ocopy-0.7.4-py3-none-any.whl:
Publisher:
release.yml on ottomatic-io/ocopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocopy-0.7.4-py3-none-any.whl -
Subject digest:
a5c2795dba949f63cb3d697fa336fb0c33473bc62f83f8491d578b74ddfa4e21 - Sigstore transparency entry: 1328155734
- Sigstore integration time:
-
Permalink:
ottomatic-io/ocopy@ceaf7e23b8734181c4aa7267daaf4675dc57f7a7 -
Branch / Tag:
refs/tags/0.7.4 - Owner: https://github.com/ottomatic-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceaf7e23b8734181c4aa7267daaf4675dc57f7a7 -
Trigger Event:
push
-
Statement type: