This library provides Python bindings for libbpf on Linux, making it easier to load eBPF object files. It is designed to be used together with PythonBPF, the eBPF compiler for Python. With these bindings, you can attach eBPF programs to kernel events directly from Python.
All programs written with this are to be run with a sudo Python interpreter.
Note: This project is under active development and not ready for production use.
Dependencies
- A compiler with C++11 support
- Pip 10+ or CMake >= 4.1
- Ninja or Pip 10+
Installation
pip install pylibbpf
Development
Clone this repository and pip install. Note the --recursive option which is
needed for the pybind11 submodule:
sudo apt install libelf-dev
git clone --recursive https://github.com/varun-r-mallya/pylibbpf.git
pip install .
With the setup.py file included in this example, the pip install command will
invoke CMake and build the pybind11 module as specified in CMakeLists.txt.
Building the documentation
The documentation here is still boilerplate.
Metadata
Release files for pylibbpf 0.0.7
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 | |
|---|---|---|---|---|
| pylibbpf-0.0.7.tar.gz | 2.7 MB | With provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylibbpf-0.0.7-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details |
| pylibbpf-0.0.7-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 4.2 MB
Release files / pylibbpf-0.0.7.tar.gz
| Download URL | pylibbpf-0.0.7.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
068ea7a61d2b9e0ac91858637f452792121aae924e173dd8fdbde65a59371bbe
|
|
BLAKE2b-256 checksum How to use checksums |
a54952fe43a700b1acf5d654702fe90d93f0aa01fdd9949e8d2df40ffe32e6af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.
Transparency logRelease files / pylibbpf-0.0.7-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | pylibbpf-0.0.7-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 765.1 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e023398efa602105c642ba997a35c1a79d5c7ee127df051eec14e53a8e3f3574
|
|
BLAKE2b-256 checksum How to use checksums |
e110ffeef86a483e3598e405d32a2a840abfdae1a92b625eb68a7c33562bc0e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.
Transparency logRelease files / pylibbpf-0.0.7-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | pylibbpf-0.0.7-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 765.1 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2c844d1ddbd060417c765786b92a2f09ce2195181e186f1e6fb3f26b097448a1
|
|
BLAKE2b-256 checksum How to use checksums |
75d51ea107a28b608c755612f04a41f6c12ccb4da6a2415c0b7c9ee58945a6b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.
Transparency logSecurity for pylibbpf 0.0.7
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.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for pylibbpf-0.0.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.
Transparency logA 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.