Skip to main content

P4Rust

Safe Rust bindings to the Perforce 2026.1 C++ API. Precompiled resources support Windows MSVC, Linux GNU, and macOS on x64 and ARM64. Consumers compile only Rust.

Published Packages

Package Link Language Compatibility
p4rust crates.io Rust Windows MSVC, Linux GNU (glibc 2.28+), macOS 12+; x64 and ARM64. Consumers compile only Rust.
p4rust PyPI Python CPython 3.9+ (cp39-abi3), including free-threaded CPython 3.15+ (cp315-abi3.abi3t); Windows, Linux (glibc 2.28+), macOS 12+; x64 and ARM64.

Rust

[dependencies]
p4rust = "0.1"
use p4rust::{Client, Config, Event, Result, ResultExt};

// Stream file records, progress, and command completion.
fn main() -> Result<()> {
    let client = Client::new(Config::new("localhost:1666", "user", "workspace"))
        .context("Failed to create client")?;
    let events = client
        .command("sync")
        .args(["D:/workspace/file.txt"])
        .run()
        .context("Failed to start sync")?;

    for event in events {
        match event.context("Failed to sync file")? {
            Event::Record(record) => {
                for (key, value) in record.fields() {
                    println!("{key}: {value}");
                }
            }
            Event::Progress(progress) => {
                println!(
                    "{:?}: {}/{}",
                    progress.kind, progress.current, progress.total
                );
            }
            Event::Message(message) | Event::HandleError(message) => {
                println!("{}", message.text);
            }
            event => println!("{event:#?}"),
        }
    }
    Ok(())
}

run() returns CommandStream, an Iterator<Item = Result<Event>>. Add .input(form), .timeout(duration), or .cancellation(&token) before run() as needed. Use collect_output() to gather the stream into one Output.

Use FastReconcile for one server connection with parallel local scanning, canonical comparisons, and move matching. Set Config.charset to utf8 for the concurrent path pipeline on Unicode servers; other encodings retain SDK traversal.

The concurrent pipeline uses the cross-platform walkdir walker and shares one metadata snapshot per path for each command, including native comparisons.

let events = client
    .command("reconcile")
    .args(["-n", "-m", "D:/workspace/..."])
    .reconcile_handler(
        p4rust::FastReconcile::new()
            .metadata_workers(8)
            .digest_workers(4)
            .move_workers(4),
    )
    .run()
    .context("Failed to start reconcile")?;

for event in events {
    println!("{:#?}", event.context("Failed to reconcile")?);
}

-n previews changes; remove it to apply them. -m uses the SDK timestamp shortcut; omit it to compare contents. Add -M for SDK move detection. A sharded path table pairs server and local records immediately; a digest table matches Add/Delete candidates, and the result table retains final SDK classifications. SDK mappings, ignore rules, file types, text conversions, and similarity matching still apply. queue_capacity() and queue_bytes() bound pending RPC tasks and metadata. Custom ReconcileHandler implementations inspect owned requests and use request.execute() for SDK computation; progress() receives pipeline counters.

Binding code is licensed under MIT; resource crates retain the Perforce and OpenSSL licenses.

Python

Install p4rust from PyPI with pip install p4rust. Wheels support ordinary CPython 3.9+ and free-threaded CPython 3.15+ on the same six platforms. Public APIs include complete typing and preserve native message codes, bytes, progress, and completion status. The Python ZIP is also available from GitHub Releases.

from p4rust import Client, Config, RecordEvent

client = Client(Config("localhost:1666", "user", "workspace"))
events = (
    client
    .command("files")
    .args(["D:/workspace/..."])
    .timeout(30.0)
    .run()
)
with events:
    for event in events:
        if isinstance(event, RecordEvent):
            print(event.record.fields())

Use .input(form), .cancellation(token), or .reconcile_handler(FastReconcile()) before .run(). collect_output() collects the remaining stream; close() cancels a command.

Maintainers

xtask builds native resources and packages all six targets. GitHub Actions runs builds, Clippy, and Python typing checks, publishes changed crates.io versions and Python wheels to PyPI, and releases separate Rust and Python ZIPs.

Metadata

Release files for p4rust 0.1.13

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

Built distributions (wheels)

Table of built distributions (wheels) for p4rust 0.1.13
File Actions
p4rust-0.1.13-cp315-abi3.abi3t-win_arm64.whl CPython 3.15 abi3t, abi3 Windows ARM64 Details for p4rust-0.1.13-cp315-abi3.abi3t-win_arm64.whl
p4rust-0.1.13-cp315-abi3.abi3t-win_amd64.whl CPython 3.15 abi3t, abi3 Windows x86-64 Details for p4rust-0.1.13-cp315-abi3.abi3t-win_amd64.whl
p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl CPython 3.15 abi3, abi3t Linux glibc 2.28+ x86-64 Details for p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl CPython 3.15 abi3t, abi3 Linux glibc 2.28+ ARM64 Details for p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_x86_64.whl CPython 3.15 abi3, abi3t macOS 12.0+ x86-64 Details for p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_x86_64.whl
p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_arm64.whl CPython 3.15 abi3, abi3t macOS 12.0+ ARM64 Details for p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_arm64.whl
p4rust-0.1.13-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for p4rust-0.1.13-cp39-abi3-win_arm64.whl
p4rust-0.1.13-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for p4rust-0.1.13-cp39-abi3-win_amd64.whl
p4rust-0.1.13-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for p4rust-0.1.13-cp39-abi3-manylinux_2_28_x86_64.whl
p4rust-0.1.13-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for p4rust-0.1.13-cp39-abi3-manylinux_2_28_aarch64.whl
p4rust-0.1.13-cp39-abi3-macosx_12_0_x86_64.whl CPython 3.9 abi3 macOS 12.0+ x86-64 Details for p4rust-0.1.13-cp39-abi3-macosx_12_0_x86_64.whl
p4rust-0.1.13-cp39-abi3-macosx_12_0_arm64.whl CPython 3.9 abi3 macOS 12.0+ ARM64 Details for p4rust-0.1.13-cp39-abi3-macosx_12_0_arm64.whl

Total release size: 43.2 MB

Release files / p4rust-0.1.13-cp315-abi3.abi3t-win_arm64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-win_arm64.whl
Size 3.0 MB
Tags CPython 3.15 Windows ARM64 abi3 abi3t
SHA-256 checksum
How to use checksums
3d4b10c038deb2342f3ba072ab83b2844ae033d424462aea0211967125d01acf
BLAKE2b-256 checksum
How to use checksums
c1cbfa51d83e75c70ba7169f55f93f14447d303db5dbc527406124d1372ff8fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp315-abi3.abi3t-win_amd64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-win_amd64.whl
Size 3.5 MB
Tags CPython 3.15 Windows x86-64 abi3 abi3t
SHA-256 checksum
How to use checksums
38e86810978e4b0792763d5b1e7c17bd6d5f52ed704cc38b72d11145609b3967
BLAKE2b-256 checksum
How to use checksums
07a8f264025c660eeafd33d399e2ef223052b3cc4b1631161a720ea5dff8ca71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
Size 4.0 MB
Tags CPython 3.15 Linux glibc 2.28+ x86-64 abi3 abi3t
SHA-256 checksum
How to use checksums
cbd3de2b8b765ee780334587b9aaf36decf50487110dde90d7b1f00048f09d54
BLAKE2b-256 checksum
How to use checksums
075ab2b1d7f82ed47de6440d68d84dc6fabda0ce99c5f69e7cab96d871651af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
Size 4.3 MB
Tags CPython 3.15 Linux glibc 2.28+ ARM64 abi3 abi3t
SHA-256 checksum
How to use checksums
c2d0cbbfe11302acab3d3de2130f1aabdbf8ffcd12aae116dc3ddd3dceb30c67
BLAKE2b-256 checksum
How to use checksums
09c98f13ad1469122377d51615e830539565de443489055cdc2b8d4ca1e8455f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_x86_64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_x86_64.whl
Size 3.2 MB
Tags CPython 3.15 abi3 abi3t macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
8359a3b1e15a462ee7907ed84f3730b662b3c115b050ad646e125aae28f6587e
BLAKE2b-256 checksum
How to use checksums
5c11509f3b2d7a2d4ade92beb3d8f32d8a844b3ef350c6a6e3061aea0599468c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_arm64.whl

Download URL p4rust-0.1.13-cp315-abi3.abi3t-macosx_12_0_arm64.whl
Size 3.5 MB
Tags CPython 3.15 abi3 abi3t macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
95b08e4bd8c2c08f4b9a8e3deb7f53d0149e9b648339883cd11d7260f3fdf2cf
BLAKE2b-256 checksum
How to use checksums
69e678c14d3a791c1d83989ea75ecaff5f54494ccac51eee0e421089bd158dcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-win_arm64.whl

Download URL p4rust-0.1.13-cp39-abi3-win_arm64.whl
Size 3.0 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
2031dd44a168c2fa6ba1ade5ef909ae4b41f4a2859bcc1d0feab2b58b14e4352
BLAKE2b-256 checksum
How to use checksums
ddfa8011e235bd73ffe268c985be9821b53cc82ae82fab4f09821e3a48f58678
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-win_amd64.whl

Download URL p4rust-0.1.13-cp39-abi3-win_amd64.whl
Size 3.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
42033dc2f3426bdaa7e37cf823f2900145eba46aa2ee621cae5d57c54cafc0c7
BLAKE2b-256 checksum
How to use checksums
7ab97e3dbb96dd39bea527a61687eac3b51874613abe5f98c071a9cb63f07429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL p4rust-0.1.13-cp39-abi3-manylinux_2_28_x86_64.whl
Size 4.0 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9066d0e07109e132c8293edad1b80195155c70a0a42b2d3b30b1dde53dab6eea
BLAKE2b-256 checksum
How to use checksums
10dcf166306d574477f605c057b90038993684035714e2e09e3fa6cb12ec45fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL p4rust-0.1.13-cp39-abi3-manylinux_2_28_aarch64.whl
Size 4.3 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
71ca697c5333540c8934505767769f19b9cf896bb66ec4e0e51c62d41979c7c6
BLAKE2b-256 checksum
How to use checksums
42ce9414ca5b83597b74e23a398f2c969869ad122e5aa3f7e764d820cebae5af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-macosx_12_0_x86_64.whl

Download URL p4rust-0.1.13-cp39-abi3-macosx_12_0_x86_64.whl
Size 3.2 MB
Tags CPython 3.9 abi3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
4108d05ce03027dcc685312d2d673b565eb745f1d767396e39c5308480c4708b
BLAKE2b-256 checksum
How to use checksums
2f2c21160c5ce02b5d6c0ba36828908e7366c4df80badc18c66580def5be125b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / p4rust-0.1.13-cp39-abi3-macosx_12_0_arm64.whl

Download URL p4rust-0.1.13-cp39-abi3-macosx_12_0_arm64.whl
Size 3.5 MB
Tags CPython 3.9 abi3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
1aeb90311585cdac17b791d1e89d2b4637311ce26d4e3e23cb841e8e0900edb4
BLAKE2b-256 checksum
How to use checksums
3024e5525bd7ac70263a45bf7cc08fb824da05d3138f58f751b0cd805f3c73f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for p4rust 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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