Skip to main content

A simple pybind11 example: a stateful C++ multiplier exposed to Python

Project description

simple_pybind11_multiplier_test

A minimal example of a C++ class exposed to Python via pybind11.

Install

pip install simple_pybind11_multiplier_test

No compiler required — pre-built wheels are available for Windows, Linux, and macOS.

Usage

import simple_pybind11_multiplier_test

m = simple_pybind11_multiplier_test.StatefulMultiplier(2.0)

print(m.multiply_by_internal_state(3.0))  # 6.0  — state is now 6.0
print(m.multiply_by_internal_state(2.0))  # 12.0 — state is now 12.0

m.set_internal_state(1.0)
print(m.multiply_by_internal_state(5.0))  # 5.0

API

StatefulMultiplier(initial_state: float)

Constructs a multiplier with the given initial internal state.

set_internal_state(value: float) -> None

Replaces the internal state with value.

multiply_by_internal_state(value: float) -> float

Multiplies value by the internal state, updates the internal state to the result, and returns it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_pybind11_multiplier_test-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win_amd64.whl (76.1 kB view details)

Uploaded CPython 3.12Windows x86-64

simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win32.whl (68.5 kB view details)

Uploaded CPython 3.12Windows x86

simple_pybind11_multiplier_test-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (103.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (68.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win_amd64.whl (75.2 kB view details)

Uploaded CPython 3.11Windows x86-64

simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win32.whl (68.1 kB view details)

Uploaded CPython 3.11Windows x86

simple_pybind11_multiplier_test-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (103.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (68.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win_amd64.whl (74.6 kB view details)

Uploaded CPython 3.10Windows x86-64

simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win32.whl (67.0 kB view details)

Uploaded CPython 3.10Windows x86

simple_pybind11_multiplier_test-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (102.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

simple_pybind11_multiplier_test-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (67.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file simple_pybind11_multiplier_test-0.1.1.tar.gz.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cfebcffa9e73206dd2c11a6be8072e62116b24c07882ac867e7d1d09a4dc1f79
MD5 351ad09962486b094917e5249a9b1a54
BLAKE2b-256 3db70dcf124386b75f5d01594a3ae56b03498ded636842d65f037e2666a82998

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1.tar.gz:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 649d2ec01b45cf4c0171c2102b7606787ea4cf4b28f1dc534f577827a1223bf8
MD5 33ef6b6e5d4517514027ab76f6667ba3
BLAKE2b-256 1b071b73899c6e2eac345ea3007443b49dcf4ed2408da38f92b2ae0b9b5d4ae2

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 86222364d2f84e9f565798543ecc8f577fb571d51586b0d0960382561b154804
MD5 eb62ab97c9dd128d9e4dfd64722642dd
BLAKE2b-256 2accbdaf54521da01f20655138590d2fd14f68fad1f4f47494f3cd02a2e8e2ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-win32.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1bc535d025aa3613749c0ab689047b09c3dd68e505a92a1712f054ec1f70d5be
MD5 90acdb52789639e4fe583fecb5281d47
BLAKE2b-256 e856116f6b1116a08f0fef6d8dade350bf5a241fc89810c720ef3fdb731cc60e

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 385a4ea69f26a8ad10a41bf0b6dfb2e4a5d4db07c75a0d44eb6aa7c031b33fb7
MD5 d2ae9c3adec9455168abe9809a9c0780
BLAKE2b-256 72f11ac014c31ab671ced7dff08a483e959e31bc67ac9c88f8bd3be8ffad0ada

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cf08fd46f88301b4562349e3cb124b63695464890ad47fa2d101eb91cc872b6
MD5 df86570f4eed073dc3a47ff4ecc65bf2
BLAKE2b-256 f8b1ce98d54f428c2aa3457eb8023b9720a805142d4a03468e37a37130a712b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e5d35d21e99a690ac9d0ed5e1c6e51396875af8c9a7e0ef7024a13a684485fa5
MD5 eb9ef0ced87e949f55487ea6b9b8b8e4
BLAKE2b-256 c23051c786c2f39d9326851def2eacf1f948abf80dce3375a63e6405221b4bd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 e66408edfd2e5ee853cabbc64e07cace92e3d5ac9f445cabf1ea7e3766bca50a
MD5 1717a49d8b9cdb6f727f11794a4ce39b
BLAKE2b-256 ff332f549f28776364f9148c0fcd74140195916ed0d0a948756ade08bf42d55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-win32.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1a7b190e20cec235855e4cc919d1cd937c97c593634b34ada9a5cd054572ce1
MD5 69eb64208e30ac9cc223580f6c1f0ad5
BLAKE2b-256 4653f3de0a4252a2c81b0028ba89a9abd7c5a5a82f4a5c96fd94d49a91addd2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db77bb2ac29774b69859d04ed3e47fd08e48ad78886ff8e2e8da2ba37656429a
MD5 fff69957aac53efbea4ae19c4e49f709
BLAKE2b-256 745af7ace2f121a7f2fcbbea905fc4a422ad8bf107f980871bbe43a725cf7f13

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee77043114547397dceeeb65c0b19213faa5ec2332db5c3f9472db3802973458
MD5 a64bacd67297bc4e0f33ec338098cde0
BLAKE2b-256 fb6896db6b5b6ae58a00d3843318ef33a93433f6b306010323b592e8cad46f4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6187942751a2fe2b34d66a6c5b6a04451ffcaf80b0abf4a3c0dd38a24bc3b63f
MD5 16f9978883da7fd0b7dc6107f1324bef
BLAKE2b-256 832845ab8eb6804d7da86232e96774f12a53c9d9c82be962d6de81d9aaa3cc57

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 64685cc314197be082ba3851a5116f4d1ab37580adf37f1413930e2c65056854
MD5 5122ed9ea3db826027c570496410d01c
BLAKE2b-256 e9ec964b03a5bcbed3a7ece115bd25bcd42e3ce0ae6db2c2231d10e263cfe470

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-win32.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b7be2d7dc6208c2e923de1895ff8a7d46fc9a3d4515118c0849da4515d1b9f31
MD5 3a12f73579d131114d4176e33178f8d8
BLAKE2b-256 aa664eb92267c8f6bae34faf1fd4463f6cd26292b9d84cf7c59030064baad1b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76d31c26fa5d408b1523945abdc81320371260e478473dcbcb158bd5d565c80c
MD5 0ee5319dbbd7e65d4d4044892892211f
BLAKE2b-256 85880289ce9c4d512348048538c44e480224448995f963bd5ff6f192076bae77

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_pybind11_multiplier_test-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49d520c3fffa8db9c8d484ceb3408756484aace8a5d82d1048ac08c932a1c64b
MD5 c7c77de33451e240813bcb4bebbdc81a
BLAKE2b-256 8c535b55a7601838989391b573ec362134110f048e9a4f4a79b06e5e24d07139

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_pybind11_multiplier_test-0.1.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on NewbieeSaibot/simple_pybind11_multiplier_test

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page