High-performance Python bindings for Chromium Embedded Framework (CEF)
Experimental and it works damn good.
Video testing: https://youtu.be/yWIah-r6sbw?si=O_uNuDDE8uSf6-Nk
Complete examples of using with Kivy, Tkinter and PyQt6 are under tests.
Thanks to pybind11 and CEF for existing in this world.
If and only if you want to support me anyhow:
Better watch a video (and there is not a video yet, lol)!!
-
Linux
Download cef minimal build for your system architecture via https://cef-builds.spotifycdn.com/index.html
mkdir -p ~/Downloads/cef_binary wget https://cef-builds.spotifycdn.com/cef_binary_146.0.9%2Bg3ca6a87%2Bchromium-146.0.7680.165_linux64_minimal.tar.bz2 -O ~/Downloads/cef_binary.tar.bz2 tar -xjf ~/Downloads/cef_binary.tar.bz2 -C ~/Downloads/cef_binary --strip-components=1
Now build the
libcef_dll_wrappermkdir ~/Downloads/cef_binary/build cd ~/Downloads/cef_binary/build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON make -j$(nproc)
Confirm the build
ls ~/Downloads/cef_binary/build/libcef_dll_wrapper/A file named
libcef_dll_wrapper.awill be listed. -
Windows
Download cef minimal build for your system architecture via https://cef-builds.spotifycdn.com/index.html
Powershell commands below
mkdir $env:USERPROFILE\Downloads\cef_binary wget "https://cef-builds.spotifycdn.com/cef_binary_146.0.9%2Bg3ca6a87%2Bchromium-146.0.7680.165_windows64_minimal.tar.bz2" ` -O $env:USERPROFILE\Downloads\cef_binary.tar.bz2 tar -xjf $env:USERPROFILE\Downloads\cef_binary.tar.bz2 -C $env:USERPROFILE\Downloads\cef_binary --strip-components=1
Now build the
libcef_dll_wrappermkdir $env:USERPROFILE\Downloads\cef_binary\build cd $env:USERPROFILE\Downloads\cef_binary\build # enable msvc build environment for you system x64 x86_64 x86 amd64 vcvarsall.bat amd64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build . --config Release --parallel
Confirm the build
Get-ChildItem $env:USERPROFILE\Downloads\cef_binary\build\libcef_dll_wrapper\ReleaseA file named
libcef_dll_wrapper.libwill be listed.
PyPI: https://pypi.org/project/pybindcef/
-
Linux
Install bare bones extension from pypi:
pip install pybindcef
OR BUILD FROM SOURCE:
Install pybind11.
pip install "pybind11[global]"Clone this repository.
git clone https://github.com/Novfensec/pybindcef -b main --single-branch --depth 1
Now build the extension with
-DPython_EXECUTABLE="pythonexecutablewithversion"mkdir pybindcef/build cd pybindcef/build cmake .. -DPython_EXECUTABLE=/usr/bin/python make -
Windows
Install pybind11.
pip install "pybind11[global]"Clone this repository.
git clone https://github.com/Novfensec/pybindcef -b main --single-branch --depth 1
Now build the extension.
mkdir pybindcef/build cd pybindcef/build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release
-
Linux
mkdir pybindcef/cef_worker/build cd pybindcef/cef_worker/build cmake .. make -
Window
mkdir pybindcef/cef_worker/build cd pybindcef/cef_worker/build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release
-
Linux
Copy all files under
cef_binary/Resourcestocef_binary/Releasecp -r ~/Downloads/cef_binary/Resources/* ~/Downloads/cef_binary/Release/
-
Windows
Copy all files under
cef_binary/Resourcesandcef_binary/Releaseright next to the extension from wherever you are accessing it. All you need to do is makelibcef.dllavailable in LD_LIBRARY_PATH and place the files undercef_binary/Resourcesnext tolibcef.dllthat's it.
-
Kivy
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/kivy/. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy
-
PyQt
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/pyqt/. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy
-
Tkinter
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/tkinter/. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy
-
Kivy
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/kivy/while also extracting resources as above instructions. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy
-
PyQt
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/pyqt/while also extracting resources as above instructions. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy
-
Tkinter
- Copy
pybindcefextension andcef_workerexecutable topybindcef/tests/tkinter/while also extracting resources as above instructions. - Run main.py with the python executable version suitable for the extension.
python main.py
- Copy