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.0b6-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.0b6-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.0b6-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.0b6-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.0b6-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.0b6-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.0b6-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.0b6-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.0b6-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 49701c44a17c6c6566ce56d9215df24ab8cae5231651a9283a87fed41c469d11
MD5 bd07b0adf05da652f0a47668f6e99610
BLAKE2b-256 996764295495b82b30215f027623f898c00bc111df0ddf62f6c03250fee67d4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30c9abb5512096b01a31de245966cd6dfe233276d92eac688e994c63739f4d4e
MD5 13f89b339c6f935ca5493aa5237acf63
BLAKE2b-256 8ce647a40b2d303c60ef2a0e4e18967a37cbd1b331051f2a23dc1be50e1474de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ccfb347adfd0a0d4d948ee9f63cb399f768345a1348fc907695dc64a8a514461
MD5 597f7ba0dc505688d3e86922a8695156
BLAKE2b-256 02bb047d42016045699429a8c83229512583e06f7e072035c5b9d3c62a71aeb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2831387f9d484e1c1c90de4d0e074d51b883be3914bb2a4db06c2b2d7fc1b36d
MD5 482f4193a76c4c84ab2cf15a43bc1161
BLAKE2b-256 8e7326da26b445e427eb6db21fc9b9a1d10d2d3dda7da4bf14ec9ebdfba8637b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e465c841e92c994a4aa3d9387fe46d1dc96a88c6aeeaaa4834964b92f200d1fc
MD5 d9081705dd98af99c1fa467d771dca17
BLAKE2b-256 f402c0a3bb9700a829c7c2f5c4172f905eee9e38642c8613760011ee73ed1e51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eaae7dc5e25ea64348877a4c968875d98f2606f5449fcc7235ed5cca7601427e
MD5 2ec1fe3b187f06a0c1be65b40adc8016
BLAKE2b-256 4c74db2a66c17491bf9c9f146a5839efcb044c998206d32b5c9ea436388fd04b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e20064848c842bf99b0f799de6553680421b5da7b6cf41d5af76828b7fd7ccf3
MD5 7ac8b910c32f142775f7f64191df66e1
BLAKE2b-256 b7fbfc3a4c81c1e8d46272445176e0c3ac994e5ac093c362c9c984038557ef43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0b6-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.0b6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac92c4f4a1b0e6fde87fdf0d32d41452cf112fffde2572cdc76120201d0ebd7e
MD5 fe87dc5b2cf31003f50b81a05c432d22
BLAKE2b-256 1be07517f099187b4130f21e81193426f78aef605d5757e5d2f77b708cfc06ee

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