Skip to main content

C++ DSP Extensions for Python.

Project description

uv Python Version from PEP 621 TOML PyPI - Implementation GitHub Actions Workflow Status 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.0a6-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.0a6-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.0a6-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.0a6-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.0a6-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.0a6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (73.0 kB view details)

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

python_cxx-0.1.0a6-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.0a6-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.0a6-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0ec6da8d0cf51c94414f99042e77c7edf47ff6f083c4b200ec092131fccb68df
MD5 ca42af182a3e35a08cd87925ff505347
BLAKE2b-256 99bc9542bf1717f1476efb9389c8f4b85b43091934c9a01c62c73eec1db1268c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66a56b9f3c2e5a587af864dea36b9564c03a4f28a256b905681ac429581bb829
MD5 9123939961fb21fa75837c3db1ce6ddd
BLAKE2b-256 6861da087abc94e08fc9034f054e898a8a11ec5dfba1d6d0a26ebae2d7f78a01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ccc12d16ba26c8e5ce23fd3e0c924a719540066c94a55a4c9328313811170669
MD5 8b84cff8af210bf12319f7506e5d030e
BLAKE2b-256 526b96dd4b2e4cc65841ef60288bfb46063c8cc571f5cc7ccaebf901616bfceb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e8333c8c33dc4ee87737f1a0319d325bbbe3140dcbb72e84cc5bbeae3d5f14a9
MD5 2ab03ac7b70971c37c57ce5a234fb307
BLAKE2b-256 c26fc4bf7d290b722a98e730b76bebf11983b07df0f2198bfca036b46a34f165

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2544f249241c13047ed9d0281f7f166fd519b340c855130e71606f0228c28db7
MD5 cff23efe90ea55ab609ebc5afaa1018a
BLAKE2b-256 4e47ef9c82050842c137c8b783db68e98a4a9a9c198d7030e655aef3297a82c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 73.0 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.0a6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 883c44715adc98f415e74c9e1313edc21304c7815a1bc4b1b08b10c5ce53e611
MD5 53274b2b752b6f1134ca1e481bbd6fa8
BLAKE2b-256 e9170f4eaaa562642aa300f059a9d18ef4c8f76e0f70ad326f9bb20af9adaff0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7623e470073647bfee24d8683a4f85b3dbb593a862e3a6960137f8064f5de412
MD5 bc85f75d8d8ddf223db24cabaef706d5
BLAKE2b-256 b80620532ea17aafcc4994f6608e4e42bbf14423a7f26bf27c9867d68c9d9c22

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cxx-0.1.0a6-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.0a6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30d956fc0f561a10d842355ba65cb0c91f38cda9685fd4b28d00ea6a661fb20a
MD5 34a75ada14235dac796d86aea256e453
BLAKE2b-256 e397e74d7e47f31f822c88d0d9c5dad42660fa526fe6d1143a69b86ba34d6a3a

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