Skip to main content

Build PyPI MIT licensed

paqPy

Hash directory or file with BLAKE3.

Python bindings to the Rust paq library.

Performance

The Go programming language repository was used as a test data source (157 MB / 14,490 files).

Tool Version Command Mean [ms] Min [ms] Max [ms] Relative
paq 2.0.0 paq ./go 73.8 ± 0.3 73.4 74.5 1.00
merkle_hash 3.9.0 merkle-hash ./go 98.3 ± 1.0 97.2 101.0 1.33 ± 0.01
b3sum 1.5.1 find ./go ... b3sum 318.8 ± 10.2 304.0 340.7 4.32 ± 0.14
checksumdir 1.3.0 checksumdir -a sha256 ./go 453.1 ± 6.5 446.5 470.6 6.14 ± 0.09
dirhash 0.5.0 dirhash -a sha256 ./go 574.9 ± 6.5 566.2 589.7 7.79 ± 0.09
GNU sha2 9.11 find ./go ... sha256sum 702.0 ± 34.2 661.6 793.4 9.51 ± 0.46
folder-hash 4.1.1 folder-hash ./go 1847.0 ± 40.0 1786.0 1928.0 25.03 ± 0.55

These are upstream paq CLI benchmarks, not measurements of the Python bindings. See the paq 2.0.0 benchmarks documentation for methodology and commands.

Installation

Install From PyPI

pip install paqpy

Install From Repository (Unstable)

Not recommended due to instability of main branch in-between tagged releases.

  1. Clone this repository.
  2. Run pip install maturin to install maturin.
  3. Run maturin develop --release from repository root.

Upgrading to v2

paqpy v2 hashes are incompatible with v1; regenerate stored hashes after upgrading. See release notes.

Usage

import paqpy

from pathlib import Path

source = Path("/path/to/source")
ignore_hidden = True # .dir or .file
source_hash = paqpy.hash_source(source, ignore_hidden, follow_links=False)

print(source_hash)

hash_source(source, ignore_hidden, follow_links=False) returns a hexadecimal hash string. Existing two-argument calls remain supported. By default, symbolic links are hashed by their target-path text, including when the source itself is a symbolic link. Set follow_links=True to hash target contents and traverse linked directories, including targets outside the source tree. Broken links and cycles raise errors when following links.

hash_source uses paq’s fallible Rust API and translates errors into Python exceptions. File system failures raise the corresponding Python OSError subclass, such as FileNotFoundError or PermissionError. Invalid UTF-8 paths raise UnicodeError, invalid source relationships raise ValueError, and other hashing failures raise paqpy.PaqError.

Visit the paq homepage for more details.

License

MIT

Metadata

Release files for paqpy 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paqpy 2.0.0
File Size Uploaded
paqpy-2.0.0.tar.gz 10.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for paqpy 2.0.0
File
paqpy-2.0.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
paqpy-2.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
paqpy-2.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details
paqpy-2.0.0-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details
paqpy-2.0.0-cp37-abi3-macosx_10_12_x86_64.whl CPython 3.7 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.7 MB

Release files / paqpy-2.0.0.tar.gz

Download URL paqpy-2.0.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed950bc1277e6a9ff11727b5e94b3f1baac25bb5b4830b3adc1f6455de5babce
BLAKE2b-256 checksum
How to use checksums
f18cc88e2ded79bee0e9e70130427d9d100772ecaad560a8bcbab5153975b300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / paqpy-2.0.0-cp37-abi3-win_amd64.whl

Download URL paqpy-2.0.0-cp37-abi3-win_amd64.whl
Size 227.3 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
33324330be02647fd11b1f32f49290f3c3bc3e94cf0f36025d54b511b2cb2866
BLAKE2b-256 checksum
How to use checksums
61dd2f0bc8ef89eac2c642ead396b24355088b710dadb2d7b5e40c0c04b6b0b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / paqpy-2.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL paqpy-2.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 383.7 kB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
1d7eab53cd7368b762b86bb3102d086802fdc76269b068f876735869c82fe1b8
BLAKE2b-256 checksum
How to use checksums
23c325af362ae1213c280bdb57fd733aa74b77801c05e230fb46a87904ca424a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / paqpy-2.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL paqpy-2.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 367.6 kB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
26b4ae63369e4bc28e934cd0757e766599d1644b272c82e3f6c652ffca8e02a6
BLAKE2b-256 checksum
How to use checksums
6bbc3ba39cf001451fd057072d55a53e987d02a836276e4203970d689f46ba10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / paqpy-2.0.0-cp37-abi3-macosx_11_0_arm64.whl

Download URL paqpy-2.0.0-cp37-abi3-macosx_11_0_arm64.whl
Size 323.3 kB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9efec2cae9b263c8b6afcd55d87e3a201998ac08b4e19c2a3c67aebe5e48ec9c
BLAKE2b-256 checksum
How to use checksums
0dbbdf8b8190ef47499994699bceb0b7249b361814381e7f9e1c520f05a7336b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / paqpy-2.0.0-cp37-abi3-macosx_10_12_x86_64.whl

Download URL paqpy-2.0.0-cp37-abi3-macosx_10_12_x86_64.whl
Size 340.4 kB
Tags CPython 3.7 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bca324152146795a04aa3d5a2375cb2ba2f6dcbd4b5a2d9b5a3385c5585e6415
BLAKE2b-256 checksum
How to use checksums
47bb8dc4aaac9a5c7147c099addd9df0c7de9ae827c21f588cb6a039a05358e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

This release

2.0.0 This release

6 release files

1.5.0

6 release files

1.4.1

6 release files

1.4.0

6 release files

1.3.3

6 release files

1.3.2

6 release files

1.3.1

6 release files

1.3.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page