Skip to main content

'Can\'t remember how to compile C++ code into a python module with pybind11? autoCppToPy is here to make it easier than ever!'

Project description

autoCppToPy

Q&A

Q: What is autoCppToPy?
A: autoCppToPy is an easy and fast way to compile C++ code into a Python module

Q: How does autoCppToPy work under the hood? A: autoCppToPy uses pybind11 to compile your C++ code into a python module

Q: How can I use CppToPy A: autoCppToPy can either be imported into your python code, allowing you to compile any C++ file yourself using autoCppToPy, or it can be used directly in the command line

CLI Documentation

Usage

(* = required)

python -m cpptopy -f <source file*> --header <header file*> -o <package name*> -l <language name = "C++"> --auto-stubs <generate auto .pyi files = False>

Example

main.hpp:

int add(int a, int b);

main.cpp:

#include "main.hpp"
int add(int a, int b) {
    return a + b
}

cli:

python -m cpptopy -f "main.cpp" --header "main.hpp" -o "my_module" --auto-stubs True

main.py

import my_module
my_module.add(2, 3)  # 5

Creator Notes

autoCppToPy is still under development. It may contain bugs and glitches or unfinished features.

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

autocpptopy-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

autoCppToPy-0.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file autocpptopy-0.0.1.tar.gz.

File metadata

  • Download URL: autocpptopy-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for autocpptopy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ff77036e2813c6340241a34127f9b86ccca19a2ae5d66aef0081cba2502de3b3
MD5 aca4d189124a8589d005d824a20f38ea
BLAKE2b-256 773f2c6a2c7efc463c09564c5d470914f0949aeeb41c7719c4adb8664533018b

See more details on using hashes here.

File details

Details for the file autoCppToPy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: autoCppToPy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for autoCppToPy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19a21fe4bdc6395bda151e686d7cc1090bb9a15e1146b1c99f14056f715d2c93
MD5 ad4680dca2482cc6ccea3e48dcc0acb0
BLAKE2b-256 a2eded5aadaeb8c75752294aab83b57318e223a4ec0d68284231f2546fa20c5b

See more details on using hashes here.

Supported by

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