by sciter-sdk

sciter-sdk / pysciter

Python bindings for Sciter

229 Stars 34 Forks Last release: over 3 years ago (0.4.10a) MIT License 174 Commits 31 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


:warning: Crowdfunding campaign to Open Source Sciter and Sciter.JS engines is in effect right now on KickStarter

You can help to Open Source the Sciter by:

  • donating to the campaign or/and
  • by spreading the word about the campaign.

Let's make it happen!

Python bindings for Sciter

Build status Build Status PyPI License Join the forums at

Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust).


Sciter is an embeddable multiplatform HTML/CSS/script engine with GPU accelerated rendering designed to render modern desktop application UI. It's a compact, single dll/dylib/so file (4-8 mb), engine without any additional dependencies.


Check screenshot gallery of the desktop UI examples.


Physically Sciter is a mono library which contains:

  • HTML and CSS rendering engine based on the H-SMILE core used in HTMLayout,
  • JavaScript alike Scripting engine – core of TIScript which by itself is based on c-smile engine,
  • Persistent Database (a.k.a. JSON DB) based on excellent DB products of Konstantin Knizhnik.
  • Graphics module that uses native graphics primitives provided by each supported platform: Direct2D on Windows 7 and above, GDI+ on Windows XP, CoreGraphics on MacOS, Cairo on Linux/GTK. Yet there is an option to use built-in Skia/OpenGL backend on each platform.
  • Network communication module, it relies on platform HTTP client primitives and/or Libcurl.

Internally it contains the following modules:

  • CSS – CSS parser and collection of parsed CSS rules, etc.
  • HTML DOM – HTML parser and DOM tree implementation.
  • layout managers – collection of various layout managers – text layout, default block layout, flex layouts. Support of positioned floating elements is also here. This module does layout calculations heavy lifting. This module is also responsible for rendering of layouts.
  • input behaviors – collection of built-in behaviors – code behind "active" DOM elements:
    , etc.
  • script module – source-to-bytecode compiler and virtual machine (VM) with compacting garbage collector (GC). This module also contains runtime implementation of standard classes and objects: Array, Object, Function and others.
  • script DOM – runtime classes that expose DOM and DOM view (a.k.a. window) to the script.
  • graphics abstraction layer – abstract graphics implementation that isolates modules above from particular platform details
    • Direct2D/DirectWrite graphics backend implementation (Windows);
    • GDI+ graphics backend implementation (Windows);
    • CoreGraphics backend implementation (Mac OS X);
    • Cairo backend implementation (GTK on all platforms including Linuxes);
    • Skia/OpenGL backend (all platforms)
  • core primitives – set of common primitives: string, arrays, hash maps and so on.

Sciter supports all standard elements defined in HTML5 specification with some additions. CSS extended to better support Desktop UI development, e.g. flow and flex units, vertical and horizontal alignment, OS theming.

Sciter SDK comes with demo "browser" with builtin DOM inspector, script debugger and documentation browser:

Sciter tools

Check website and its documentation resources for engine principles, architecture and more.

Getting started:

  1. Download Sciter SDK and extract it somewhere.
  2. Add target platform binaries to PATH (
    ) and install Sciter shared library to your LIBRARY_PATH.
  3. Install pysciter:
    python3 install
    pip install pysciter
  4. Run minimal pysciter sample:
    python3 examples/
    . Also you can run script from zip archive directly:
    python3 ./

Brief look:

Minimal sciter app is extremely small:

import sciter

if name == 'main': frame = sciter.Window(ismain=True, uni_theme=True) frame.load_file("minimal.htm") frame.expand() frame.run_app()

It looks similar to this:

Minimal pysciter sample


In respect of tiscript functions calling:

answer = self.call_function('script_function', "hello, python!", "and", ["other", 3, "arguments"])

Calling python from script can be implemented as following: ```python def GetNativeApi(): # called from sciter.EventHandler.onscriptcall def on_add(a, b): return a + b

def on_sub(a, b): raise Exception("sub(%d,%d) raised exception" % (a, b))

api = { 'add': onadd, # plain function 'sub': onsub, # raise exception at script 'mul': lambda a,b: a * b } # lambdas supported too return api ```

So, we can access our api now: ``

represents window where script is runnung.
stdout` stream is a standard output stream (shell or debugger console, for example)

var api = view.GetNativeApi();

// returned

object looks like {add: function(a,b) { return a + b; }}; stdout.println("2 + 3 = " + api.add(2, 3)); ```

Check pysciter/examples folder for more complex usage.

What supported right now:

  • [x] sciter::window which brings together window creation, host and event handlers
  • [x] sciter::host extensible implementation with transparent script calls from python code
  • [x] sciter::event_handler with basic event handling (attached, documentcomplete, onscript_call), additional handlers will come
  • [x] sciter::dom for HTML DOM access and manipulation methods
  • [x] sciter::value pythonic wrapper with sciter::scripterror and sciter::nativefunction support
  • [ ] sciter::behavior_factory - global factory for native behaviors
  • [ ] sciter::graphics - platform independent graphics native interface (can be used in native behaviors)
  • [ ] sciter::request - resource request object, used for custom resource downloading and handling
  • [ ] sciter::video - custom video rendering
  • [ ] sciter::archive - Sciter's compressed archive produced by sdk/bin/packfolder
  • [ ] sciter::msg - Backend-independent input event processing


  • [x] Windows
  • [x] OSX
  • [x] Linux
  • [x] Raspberry Pi

Python 3.x.


Bindings library licensed under MIT license. Sciter Engine has the own license terms and end used license agreement for SDK usage.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.