# Building Python Extension Modules in Assembly

This repository is a proof-of-concept to demonstrate how you can create a Python Extension in 100% assembly.
Demonstrates:
How to write a Python module in pure assembly
How to write a function in pure assembly and call it from Python with Python objects
How to call the C API to create a PyObject and parse PyTuple (arguments) into raw pointers
How to pass data back into Python
How to register a module from assembly
How to create a method definition in assembly
How to write back to the Python stack using the dynamic module loader
How to package a NASM/Assembly Python extension with distutils
The simple proof-of-concept function takes 2 parameters,
`default >>> import pymult >>> pymult.multiply(2, 4) 8 `
## But, Why?
Just because it can be done.
Also, I want to see if some AVX/AVX2 instructions (high-performance matrix multiplication especially) can be used directly from Python.
Metadata
Release files for pymult 0.0.2
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 |
|---|---|---|---|---|
| pymult-0.0.2.tar.gz | 5.3 kB | Without provenance | Details for pymult-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymult-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl | CPython 3.8 | CPython 3.8 | macOS 10.9+ x86-64 | Details for pymult-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl |
Total release size: 9.5 kB
Release files / pymult-0.0.2.tar.gz
| Download URL | pymult-0.0.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4b7cf93c6d15f88a4b164acdf1e47217e7c15c26a274a97e74594a914eff230
|
|
BLAKE2b-256 checksum How to use checksums |
9d4b009a80a2ea47b9ac80b16d1c24c22d0cd457b9f01f6ed5c4fd9b9c5f34e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
|
Release files / pymult-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | pymult-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.2 kB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
7bfbb0d2a04315b583f56a2f38a2e848e6040dc4df326f6cec303b4729c89ab6
|
|
BLAKE2b-256 checksum How to use checksums |
f4727feb256800dd75b1d0a18b7acc883220f697532cc4f9a1cac08071fc6462
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
|
Security for pymult 0.0.2
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.