Türkçe
Modern desktop windows, in plain Python
Write the window in Python: boxes, texts, buttons and ready components appear in a small window of its own. Only Python: no JavaScript, no HTML, no browser tab, no server.
v0.1.2 · experimental · Python 3.9+ · tested on macOS and Windows · 54 components with a Python class · all 88 of basic.js by name · basic.js inside: about 3 MB, no internet · Apache 2.0
The handbook: ten short chapters, from the first window to a component of your own, in English and Turkish.
A counter in a few lines
Groups place the objects for you, and a function given to a button runs in Python when it is clicked.
- with blocks. The objects of a with block go into its group: the shape of the code is the shape of the window.
- Values in Python. count.text is read in Python, with no question to the window. Setting it changes the window.
- One call for a function. All the changes of a click go to the window together, so a click costs about 3 ms.
Small, fast enough, easy to read
- Small and offline. The package carries basic.js and its components (about 3 MB); no internet, no server, no browser tab.
- Fast enough to forget. A click reaches your Python function and comes back on the screen in about 3 ms. The window shows in about 0.5 s.
- Code that reads like the window. with blocks for groups, the names of basic.js, values read back without asking the window. An error points to your line.
- Components ready. 54 components have a Python class: buttons, fields, lists, a table, a chart, dialogs. All 88 of basic.js work with Component().
Ready components, Python classes
SmartButton, TextField, EmailField, PasswordField, NumberField, UrlField, PhoneField, CurrencyField, TextAreaField, TagInput, SearchInput, CheckBox, Toggle, RadioButton, SelectBox, Slider, RangeSlider, SliderField, Stepper, DatePicker, TimePicker, ColorPicker, FilePicker, ProgressBar, StepBar, LoadingScreen, Canvas, ItemList, SortableList, SmartTable, DataTable, TreeView, Tabs, Accordion, SidePanel, ScrollArea, GridGroup, GraphBox, LogView, ImageView, MarkdownView, JsonView, JsonEditor, ChatView, WebView, MenuBar, ToolBar, ContextMenu, StatusBar, Splitter, CodeEditor, Tooltip, Dialog and Toast. Each one takes its params in snake_case and a Python function for a callback.
A component of your own, in plain Python
A class that makes its objects in a with block is a component: use it again and again, change it with its methods, share it as a .py file. No JavaScript is needed.
A dialog that returns its answer
Dialog.confirm() waits for the answer and returns it, like any function. The window keeps working meanwhile: timers run and the page is drawn.
Twenty-seven small programs
A small code editor, A small Markdown editor, A small JSON viewer, A small JSON editor, A chat, Photos, Paint, Charts, A file tool, CSV viewer, A form, Image viewer, A job and its log, Word counter, To do, Settings, Dialogs, Gallery, The gallery in its own look, The minimal look, The minimal look in a color, Calculator, The basic objects, Counter, Greeting, Clock and Catch the dots, in the examples folder of the source. Each one is checked in its real window.
Where it fits
A good choice for a small tool or a script that needs a window, for teaching Python with something to see, and for a modern look without learning Qt, HTML or CSS. For a large desktop application, Qt (PySide6) or Flet is better; for a web application for many users, NiceGUI or a web framework; for a data dashboard in the browser, Streamlit.
Three steps
- Install. Not on PyPI yet. Until then, install it from its source folder, in a virtual environment. It brings pywebview, the window of the system.
- Write start(page). Make the objects of the window in it. Groups place them; a function runs on a click.
- Run it. A window opens. Your program ends when it is closed.
OzdenUI is open source under the Apache 2.0 license. This page is built with basic.js. © 2020–2026 Buğra Özden.