Table of contents:
CEF Python is an open source project founded by Czarek Tomczak in 2012 to provide Python bindings for the Chromium Embedded Framework (CEF). The Chromium project focuses mainly on Google Chrome application development while CEF focuses on facilitating embedded browser use cases in third-party applications. Lots of applications use CEF control, there are more than 100 million CEF instances installed around the world. There are numerous use cases for CEF:
- Use it as a modern HTML5 based rendering engine that can act as a replacement for classic desktop GUI frameworks. Think of it as Electron for Python.
- Embed a web browser widget in a classic Qt / GTK / wxPython desktop application
- Render web content off-screen in applications that use custom drawing frameworks
- Use it for automated testing of web applications with more advanced capabilities than Selenium web browser automation due to CEF low level programming APIs
- Use it for web scraping, as a web crawler or other kind of internet bots
CEF Python also provides examples of embedding CEF for many Python GUI frameworks such as PyQt, wxPython, PyGTK, PyGObject, Tkinter, Kivy, Panda3D, PyGame, PyOpenGL, PyWin32, PySide and PySDL2.
Command to install with pip:
pip install cefpython3==66.1
Hosted at pypi/cefpython3. On Linux pip 8.1+ is required.
You can also download packages for offline installation available on the GitHub Releases pages.
Below is a table with supported platforms, python versions and architectures.
OS | Py2 | Py3 | 32bit | 64bit | Requirements |
---|---|---|---|---|---|
Windows | 2.7 | 3.4 / 3.5 / 3.6 / 3.7 / 3.8 / 3.9 | Yes | Yes | Windows 7+ (Note that Python 3.9 supports Windows 8.1+) |
Linux | 2.7 | 3.4 / 3.5 / 3.6 / 3.7 | Yes | Yes | Debian 8+, Ubuntu 14.04+, Fedora 24+, openSUSE 13.3+ |
Mac | 2.7 | 3.4 / 3.5 / 3.6 / 3.7 | No | Yes | MacOS 10.9+ |
- Ask questions and report problems on the Forum
- Supported examples are listed in the README-examples.md file
- Documentation is in the docs/ directory:
- API reference is in the api/ directory:
- Additional documentation is available in Issues labelled Knowledge Base
- To search documentation use GitHub "This repository" search at the top. To narrow results to documentation only select "Markdown" in the side pane.
To support general CEF Python development efforts you can make a donation using PayPal button below:
CEF Python is seeking companies to sponsor development of this project. Most important thing would be to have continuous monthly releases with updates to latest Chromium. There is also lots of cool features and new settings that would be nice to implement. We have not yet exposed all of upstream CEF APIs. If your company would like to sponsor CEF Python development efforts then please contact Czarek. There are no active sponsors at this moment.
- cefpython module
- ApplicationSettings dictionary
- BrowserSettings dictionary
- CommandLineSwitches dictionary
- Browser object
- Callback object
- Cookie class
- CookieManager class
- DpiAware class (Win)
- DragData object
- Frame object
- Image object
- JavascriptBindings class
- JavascriptCallback object
- PaintBuffer object
- Request class
- Response object
- WebPluginInfo object
- WebRequest class
- WindowInfo class
- WindowUtils class
- AccessibilityHandler
- DisplayHandler
- DownloadHandler
- FocusHandler
- JavascriptDialogHandler
- KeyboardHandler
- LifespanHandler
- LoadHandler
- RenderHandler
- RequestHandler
- ResourceHandler
- V8ContextHandler
- CookieVisitor interface
- StringVisitor interface
- WebRequestClient interface
- AccessibilityHandler (interface)
- Application settings
- accept_language_list
- app_user_model_id
- auto_zooming
- background_color
- browser_subprocess_path
- cache_path
- command_line_args_disabled
- context_menu
- downloads_enabled
- external_message_pump
- framework_dir_path
- ignore_certificate_errors
- javascript_flags
- locale
- locales_dir_path
- debug
- log_file
- log_severity
- multi_threaded_message_loop
- net_security_expiration_enabled
- pack_loading_disabled
- persist_session_cookies
- persist_user_preferences
- product_version
- remote_debugging_port
- resources_dir_path
- single_process
- string_encoding
- uncaught_exception_stack_size
- unique_request_context_per_browser
- user_agent
- user_data_path
- windowless_rendering_enabled
- Browser (object)
- AddWordToDictionary
- CanGoBack
- CanGoForward
- CloseBrowser
- CloseDevTools
- DragTargetDragEnter
- DragTargetDragOver
- DragTargetDragLeave
- DragTargetDrop
- DragSourceEndedAt
- DragSourceSystemDragEnded
- ExecuteFunction
- ExecuteJavascript
- Find
- GetClientCallback
- GetClientCallbacksDict
- GetFocusedFrame
- GetFrame
- GetFrameByIdentifier
- GetFrames
- GetFrameCount
- GetFrameIdentifiers
- GetFrameNames
- GetImage
- GetJavascriptBindings
- GetMainFrame
- GetNSTextInputContext
- GetOpenerWindowHandle
- GetOuterWindowHandle
- GetSetting
- GetUrl
- GetUserData
- GetWindowHandle
- GetIdentifier
- GetZoomLevel
- GoBack
- GoForward
- HandleKeyEventAfterTextInputClient
- HandleKeyEventBeforeTextInputClient
- HasDevTools
- HasDocument
- Invalidate
- IsFullscreen
- IsLoading
- IsMouseCursorChangeDisabled
- IsPopup
- IsWindowRenderingDisabled
- LoadUrl
- Navigate
- NotifyMoveOrResizeStarted
- NotifyScreenInfoChanged
- ParentWindowWillClose
- Reload
- ReloadIgnoreCache
- ReplaceMisspelling
- SetAutoResizeEnabled
- SetBounds
- SendKeyEvent
- SendMouseClickEvent
- SendMouseMoveEvent
- SendMouseWheelEvent
- SendFocusEvent
- SendCaptureLostEvent
- SetAccessibilityState
- SetClientCallback
- SetClientHandler
- SetFocus
- SetMouseCursorChangeDisabled
- SetJavascriptBindings
- SetUserData
- SetZoomLevel
- ShowDevTools
- StartDownload
- StopLoad
- StopFinding
- ToggleFullscreen
- TryCloseBrowser
- WasResized
- WasHidden
- Browser settings
- Font settings
- accept_language_list
- application_cache_disabled
- background_color
- databases_disabled
- default_encoding
- dom_paste_disabled
- file_access_from_file_urls_allowed
- inherit_client_handlers_for_popups
- image_load_disabled
- javascript_disabled
- javascript_close_windows_disallowed
- javascript_access_clipboard_disallowed
- local_storage_disabled
- plugins_disabled
- remote_fonts
- shrink_standalone_images_to_fit
- tab_to_links_disabled
- text_area_resize_disabled
- universal_access_from_file_urls_allowed
- user_style_sheet_location
- web_security_disabled
- webgl_disabled
- windowless_frame_rate
- Callback (object)
- cefpython
- CreateBrowser
- CreateBrowserSync
- ExceptHook
- GetAppSetting
- GetAppPath
- GetBrowserByIdentifier
- GetBrowserByWindowHandle
- GetCommandLineSwitch
- GetDataUrl
- GetGlobalClientCallback
- GetModuleDirectory
- GetVersion
- Initialize
- IsThread
- LoadCrlSetsFile
- MessageLoop
- MessageLoopWork
- PostTask
- PostDelayedTask
- QuitMessageLoop
- SetGlobalClientCallback
- SetGlobalClientHandler
- SetOsModalLoop
- Shutdown
- Command line switches
- Cookie (class)
- CookieManager (class)
- CookieVisitor (interface)
- DisplayHandler (interface)
- DownloadHandler
- DpiAware (class)
- DragData (object)
- FocusHandler (interface)
- Frame (object)
- Image (object)
- JavascriptBindings (class)
- JavascriptCallback (object)
- JavascriptDialogHandler (interface)
- KeyboardHandler (interface)
- LifespanHandler (interface)
- LoadHandler (interface)
- Network error
- ERR_NONE
- ERR_ABORTED
- ERR_ACCESS_DENIED
- ERR_ADDRESS_INVALID
- ERR_ADDRESS_UNREACHABLE
- ERR_CACHE_MISS
- ERR_CERT_AUTHORITY_INVALID
- ERR_CERT_COMMON_NAME_INVALID
- ERR_CERT_CONTAINS_ERRORS
- ERR_CERT_DATE_INVALID
- ERR_CERT_END
- ERR_CERT_INVALID
- ERR_CERT_NO_REVOCATION_MECHANISM
- ERR_CERT_REVOKED
- ERR_CERT_UNABLE_TO_CHECK_REVOCATION
- ERR_CONNECTION_ABORTED
- ERR_CONNECTION_CLOSED
- ERR_CONNECTION_FAILED
- ERR_CONNECTION_REFUSED
- ERR_CONNECTION_RESET
- ERR_DISALLOWED_URL_SCHEME
- ERR_EMPTY_RESPONSE
- ERR_FAILED
- ERR_FILE_NOT_FOUND
- ERR_FILE_TOO_BIG
- ERR_INSECURE_RESPONSE
- ERR_INTERNET_DISCONNECTED
- ERR_INVALID_ARGUMENT
- ERR_INVALID_CHUNKED_ENCODING
- ERR_INVALID_HANDLE
- ERR_INVALID_RESPONSE
- ERR_INVALID_URL
- ERR_METHOD_NOT_SUPPORTED
- ERR_NAME_NOT_RESOLVED
- ERR_NO_SSL_VERSIONS_ENABLED
- ERR_NOT_IMPLEMENTED
- ERR_RESPONSE_HEADERS_TOO_BIG
- ERR_SSL_CLIENT_AUTH_CERT_NEEDED
- ERR_SSL_PROTOCOL_ERROR
- ERR_SSL_RENEGOTIATION_REQUESTED
- ERR_SSL_VERSION_OR_CIPHER_MISMATCH
- ERR_TIMED_OUT
- ERR_TOO_MANY_REDIRECTS
- ERR_TUNNEL_CONNECTION_FAILED
- ERR_UNEXPECTED
- ERR_UNEXPECTED_PROXY_AUTH
- ERR_UNKNOWN_URL_SCHEME
- ERR_UNSAFE_PORT
- ERR_UNSAFE_REDIRECT
- PaintBuffer (object)
- RenderHandler (interface)
- Request (class)
- RequestHandler (interface)
- ResourceHandler (interface)
- Response (object)
- StringVisitor (interface)
- V8ContextHandler (interface)
- Virtual Key codes
- WebPluginInfo (object)
- WebRequest (class)
- WebRequestClient (interface)
- WindowInfo (class)
- WindowUtils (class)