Skip to main content

C++ DSP Extensions for Python.

Project description

uv Python Version from PEP 621 TOML PyPI - Implementation Build PyPI - Wheel GitHub License

python-cxx

C/C++ DSP Extensions for Python.

Building the foundation for a fast, reliable, easy-to-use signal processing toolset.

This package is about real-world utility, learning, and most of all fun!

Installation

With uv (install uv with curl -LsSf https://astral.sh/uv/install.sh | sh)

uv install git+github.com/hunterdsp/python-cxx.git

or pip

python3 -m venv .venv && . .venv/bin/activate
pip install git+github.com/hunterdsp/python-cxx.git

Usage

Once the package has been installed you can run the example with

python-cxx-example

If successful, you should see something like this

---------------------------------------------------------
Hello from python_cxx!!!
A C++ compiled extension that can operate in Python.
For example, given a list [1, 2, 3]...one can use:
---------------------------------------------------------
* Typecasting to e.g. square: python_cxx.IntVector([1, 4, 9])
* Binding to e.g. double: python_cxx.IntVector([2, 4, 6])
* Or wrap an operation like decrement: [0, 1, 2]!
Executing a C++ class method on [1. 1. 1. 1. 1.] gives:
Exponential average: [0.9     0.99    0.999   0.9999  0.99999]

Benchmark Results
-----------------
* Ran 100 trials 5 times.
* Time of one independent trial: 2.92 msec
* Best time of subsequent trials: 2.7 msec
* Worst time of subsequent trials: 2.92 msec
* Best speed: 152 Mitems / sec
* Worst speed: 140 Mitems / sec

Experiment with the example script (python-cxx/example.py), use with the interpreter, or add your own features!

>>> import numpy as np
>>> from python_cxx import decrement_it
>>> x = [1, 2, 3]
>>> decrement_it(x)
[0, 1, 2]

Source Installation

Get the code and move into the project directory

git clone https://github.com/hunterdsp/python-cxx.git && cd python-cxx

Install with uv (recommended)

uv sync

or pip

python3 -m venv .venv && . .venv/bin/activate
pip install .

For Developers

Install

Get uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Get the code and go to the project directory

git clone https://github.com/hunterdsp/python-cxx.git && cd python-cxx

Synchronize dependencies and install

uv sync

Develop

  • Edit the code
  • Add testing
  • Commit!
  • Synchronize: uv sync
  • Run scripts e.g.: uv run --no-editable python-cxx-example
  • Ensure ALL tests pass: uvx pytest
  • Repeat until you make it here with no failures
  • Submit a pull-request!

... more coming soon ... Have Fun!!!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

python_cxx-0.1.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

python_cxx-0.1.0b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (72.3 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_cxx-0.1.0b1-cp314-cp314-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

python_cxx-0.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (73.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_cxx-0.1.0b1-cp313-cp313-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

python_cxx-0.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (72.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_cxx-0.1.0b1-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

python_cxx-0.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (73.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file python_cxx-0.1.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.14t, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7550fab3c4aaa79fef9b0be3f9ad44fac56a1d491e243322635a73a7db4e5238
MD5 0223dd9e01ef68fbd83a2decbf205720
BLAKE2b-256 43a85110caeff90b89b9e88777770313285acb77827c1990de5f2a8194d6603b

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 72.3 kB
  • Tags: CPython 3.14t, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f839b36faa7bce4a90887cc945b9bda641b43c4983cdea236270de8b86ae6cdf
MD5 98d3837f2fc43c37614d611c4a7ade82
BLAKE2b-256 19e4596739bf10aae308b7bc18dfdcc76c678c15f9fefbef84b62d851a437b2c

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp314-cp314-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.14, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cbf8a862a2dff484cbb233ed91a001e7b60e5651c81f30e1a3358ea6152b8a0a
MD5 4e379791c43c5256e1e91ea7a866bc53
BLAKE2b-256 248d67eb85f247b2d13df03c17e4879c5bca30ef2f36be819feb7ed5fa6a50bf

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4308f0c286e212aaf1693db0de5ae2942f34cf8719e38abc5d6165d795faa8f8
MD5 f1b0e5d94e91b9d7ceb7788398195a07
BLAKE2b-256 05d61373c77b9e9e947acc7c06f67d6bee75b027a97dec4b9a1feeee6a8ac588

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp313-cp313-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 685b2b5c6731ac64b5d4120ed21976b51b3f99e6a66ce13c1e71ff1842e942cb
MD5 9003bf4eda76e23029f05d07a691cb1f
BLAKE2b-256 281d72a57762c95c834d4d97bf4a4d68d1d47d48b45dc431a076b89cf6c2a061

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 72.9 kB
  • Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04ad9b438adc3f9913bc5dbe22ed09a3d5f960f2147f0d76a120b1a1f58a4df7
MD5 adb3614b074ff6bc44b151fa62b54378
BLAKE2b-256 5eb2871693a228d87c8208427008cd6c838e0dc50d966af6f6a9c598c0dbcc1f

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp312-cp312-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 15845b6841b8dc57c499405ae20c65a09449b75bf68169397340819bfdbe6cca
MD5 c3b63c8f0a6a9dddb2bcc73aa1dc728d
BLAKE2b-256 10cb8a9e89ff97a7e193760f59fa48215ad8086c064cf6d587e00c8120d95d3f

See more details on using hashes here.

File details

Details for the file python_cxx-0.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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}

File hashes

Hashes for python_cxx-0.1.0b1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 259cd4a91cfbf6dd2a40f7d6c27018a459a7b88b2c3b701d3bcfcc1ae62e26de
MD5 ba5dffed7c3f17626a8c4ec6091692a9
BLAKE2b-256 21cf310d58ecd266d6e81985c09e48a695ae2b1760b6117a35ba71f3596c1e5e

See more details on using hashes here.

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