camazotz
C code in Python code
introduction
Camazotz compiles and loads C code in Python code. Specifically, it enables insertion of C code directly into Python files, which can be dynamically linked and called via ctypes.
setup
pip install camazotz
usage
export CC="gcc"
import camazotz
library = camazotz.C(
"""
#include <stdio.h>
int factorial(int x){
int result = 1;
while (x > 1){
result *= x;
x--;
}
return result;
}
"""
)
function_factorial = library["factorial"]
print("5! =", function_factorial(5))
print("4! =", function_factorial(4))
Metadata
Release files for camazotz 2017.3.20.1950
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| camazotz-2017.3.20.1950.tar.gz | 15.1 kB | Without provenance | Details for camazotz-2017.3.20.1950.tar.gz |
Release files / camazotz-2017.3.20.1950.tar.gz
| Download URL | camazotz-2017.3.20.1950.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f56cc0f87c3d08b427337b32c9b4b120d97db3649dd96c40c036fb639f2a435
|
|
BLAKE2b-256 checksum How to use checksums |
a9a1b982a357af42da5fe179e98c760054c6d6004244a218296af6d278d4dd5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for camazotz 2017.3.20.1950
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.