Skip to main content

wccs (Python)

Python binding for WCCS, the Weighted Credit-Cooldown Sampler.

This package is a thin ctypes layer over the versioned C ABI. It contains no algorithm logic — all sampling happens in the C core. By default it calls wccs_new_default, which injects the core's deterministic PCG64, so the same seed produces the same sequence in every language (L2).

Install

pip install wccs                # from PyPI: platform wheel, native library included
pip install ./bindings/python   # or from a source checkout

Release wheels bundle the native library inside the wccs package, so nothing else is required. For a source checkout without a bundled library, build it with CMake (cmake -B build && cmake --build build) or point the loader at an existing build:

export WCCS_LIBRARY_PATH=/path/to/libwccs.so   # or .dll / .dylib

Usage

from wccs import Sampler

with Sampler([1, 2, 3, 4], L=3, beta_q=0, R=1000, seed=42) as s:
    for _ in range(10):
        print(s.sample())
    print(s.step, s.total)

Pass rng= (a callable returning a 64-bit integer) to exercise the C ABI's random-source injection via wccs_new. Doing so gives up the L2 guarantee unless every language injects the identical engine.

Errors are raised as wccs.WccsError with a stable .code.

Tests

PYTHONPATH=. python -m unittest discover -s tests -v
PYTHONPATH=. python tests/vector.py     # cross-language vector emitter

License: Apache-2.0

Metadata

Release files for wccs 1.0.2

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 wccs 1.0.2
File Actions
wccs-1.0.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for wccs-1.0.2-py3-none-win_amd64.whl
wccs-1.0.2-py3-none-win32.whl Python 3 none Windows x86-32 Details for wccs-1.0.2-py3-none-win32.whl
wccs-1.0.2-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for wccs-1.0.2-py3-none-manylinux_2_35_x86_64.whl
wccs-1.0.2-py3-none-manylinux_2_35_i686.whl Python 3 none Linux glibc 2.35+ x86-32 Details for wccs-1.0.2-py3-none-manylinux_2_35_i686.whl
wccs-1.0.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for wccs-1.0.2-py3-none-macosx_11_0_arm64.whl

Total release size: 126.5 kB

Release files / wccs-1.0.2-py3-none-win_amd64.whl

Download URL wccs-1.0.2-py3-none-win_amd64.whl
Size 12.5 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dcf7d68fa217e4bba85f782abeeca0f9f6fb6765d5d756c60a7fa67de1a436ef
BLAKE2b-256 checksum
How to use checksums
7d07a998e1ff514b5e85eedadbb643ce1661b1ded7ee724526be03650f8ce263
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wccs-1.0.2-py3-none-win32.whl

Download URL wccs-1.0.2-py3-none-win32.whl
Size 82.9 kB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
15c023cf000129c4f5c4fc9a3eedba8f2bb74596a79baf315dee9a6373071e63
BLAKE2b-256 checksum
How to use checksums
36cae7c1674f34e68868724985e5a25d6866a594f981b83bc92cd1d904191a30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wccs-1.0.2-py3-none-manylinux_2_35_x86_64.whl

Download URL wccs-1.0.2-py3-none-manylinux_2_35_x86_64.whl
Size 10.9 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a18d4aed9ff9b18ece3b6c30c19dbb4256b7d96b0771287ff08a367cb5bb8949
BLAKE2b-256 checksum
How to use checksums
6ba9f55eac3c1e97644e9939f9c2bc8ba1971de5e6e5c735754ceea5c6f0a011
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wccs-1.0.2-py3-none-manylinux_2_35_i686.whl

Download URL wccs-1.0.2-py3-none-manylinux_2_35_i686.whl
Size 11.5 kB
Tags Linux glibc 2.35+ x86-32 Python 3
SHA-256 checksum
How to use checksums
b9e980a5f392872c9189ffb7436c4fd6046432b40c7a190b8ffda7cd5470d913
BLAKE2b-256 checksum
How to use checksums
e892178b29dbbc2848af4c9b527d442e20ce97466650e417f76e5a694b82a0e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wccs-1.0.2-py3-none-macosx_11_0_arm64.whl

Download URL wccs-1.0.2-py3-none-macosx_11_0_arm64.whl
Size 8.8 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
41f37611cd1b33797f6d69785f06c55bb29ed11d7626ae1fdebc92e55993c565
BLAKE2b-256 checksum
How to use checksums
201e22c637f5f7a6fde355f860da0ae4897bd18af56ff4aa7c7ae13688f4ed3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for wccs 1.0.2

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