pybind11
pythran
Our great sponsors
pybind11 | pythran | |
---|---|---|
42 | 7 | |
14,741 | 1,964 | |
1.7% | - | |
8.7 | 8.0 | |
7 days ago | 17 days ago | |
C++ | C++ | |
GNU General Public License v3.0 or later | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pybind11
-
Experience using crow as web server
I'm investigating using C++ to build a REST server, and would love to know of people's experiences with Crow-- or whether they would recommend something else as a "medium-level" abstraction C++ web server. As background, I started off experimenting with Python/FastAPI, which is great, but there is too much friction to translate from pybind11-exported C++ objects to the format that FastAPI expects, and, of course, there are inherent performance limitations using Python, which could impact scaling up if the project were to be successful.
- Swig – Connect C/C++ programs with high-level programming languages
-
returning numpy arrays via pybind11
I have a C++ function computing a large tensor which I would like to return to Python as a NumPy array via pybind11.
-
I created smooth_lines python module, great for drawing software
This is based on the Google Ink Stroke Modeler C++ library, and using pybind11 to make it available on python.
-
Facial Landmark Detection with C++
pybind11 makes it easy to call C++ from Python if you want to mix.
-
Python’s Multiprocessing Performance Problem
If you've never used Pybind before these pybind tests[1] and this repo[2] have good examples you can crib to get started (in addition to the docs). Once you handle passing/returning/creating the main data types (list, tuple, dict, set, numpy array) the first time, then it's mostly smooth sailing.
Pybind offers a lot of functionality, but core "good parts" I've found useful are (a) use a numpy array in Python and pass it to a C++ method to work on, (b) pass your python data structure to pybind and then do work on it in C++ (some copy overhead), and (c) Make a class/struct in C++ and expose it to Python (so no copying overhead and you can create nice cache-aware structs, etc.).
[1] https://github.com/pybind/pybind11/blob/master/tests/test_py...
- Making Python Web Application with C++ Backend
-
Using pybind11 with minGW to cross compile pyhton module for Windows
I have a python module for which the logic is written in C++ and I use pybind11 to expose the objects and functions to Python.
-
IPC communication between rust, c++, and python
Reading from Python requires a wrapper, using pybind11 this is fairly done.
-
[ADVICE] Python to C++
Also I can highly recommend starting using C++ to augment your Python code, i.e. find the parts that are slow or undoable in Python and write those in C++ then expose them as Python functions. You can use https://github.com/pybind/pybind11 to call C++ code from Python.
pythran
- Codon: Python Compiler
-
How Python virtual environments work
Numpy and Scipy are good reasons. Unfortunately Scipy does not even compile on FreeBSD lately, and I have opened three issues about it against Scipy and Pythran (and the fix was with xsimd).
https://github.com/serge-sans-paille/pythran/issues/2070
-
S6: A standalone JIT compiler library for CPython
In someone lands here seeking a maintained compiler for Python, there's a lot, on top of my head:
- Pythran (https://pythran.readthedocs.io) (ahead of time compiler)
-
Accelerate Python code 100x by import taichi as ti
Yes, I mean Pythran ( https://github.com/serge-sans-paille/pythran ). Thank you.
Was Nuitka better? Pythran is quite simple to install and use in Jupyter.
-
Omyyyy/pycom: A Python compiler, down to native code, using C++
The only project that compares 1:1 is Pythran: https://github.com/serge-sans-paille/pythran
Pythran is fairly nice, and it really does work. I tried it last year and it compiles down to modifiable templated C++. I was able to use it to build Python for a highly specialized environment.
All the others compile down to dynamically linked binaries, and that just puts them in the "other" box.
-
OpenAI Codex Python to C++ Code Generator
You might want to contact the author of Pythran [1], maybe something can be learned from what they do.
[1] https://github.com/serge-sans-paille/pythran/commits/master
-
PyO3: Rust Bindings for the Python Interpreter
[1] https://github.com/serge-sans-paille/pythran
What are some alternatives?
PyO3 - Rust bindings for the Python interpreter
rust-numpy - PyO3-based Rust bindings of the NumPy C-API
nanobind - nanobind: tiny and efficient C++/Python bindings
setuptools-rust - Setuptools plugin for Rust support
Optional Argument in C++ - Named Optional Arguments in C++17
RustPython - A Python Interpreter written in Rust
codex_py2cpp - Converts python code into c++ by using OpenAI CODEX.
sol2 - Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
shedskin - Shed Skin is a restricted-Python-to-C++ compiler. Read the introduction below to learn about the restrictions.
PEGTL - Parsing Expression Grammar Template Library
Nuitka - Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.