Cross-platform native UI toolkit for Android and iOS
Project description
Build native Android and iOS apps in Python.
Documentation · Getting Started · Examples · Contributing
Overview
PythonNative is a cross-platform toolkit for building native Android and iOS apps in Python. It provides a declarative, React-like component model with automatic reconciliation, powered by Chaquopy on Android and rubicon-objc on iOS. Describe your UI as a tree of elements, manage state with set_state(), and let PythonNative handle creating and updating native views.
Features
- Declarative UI: Describe what your UI should look like with element functions (
Text,Button,Column,Row, etc.). PythonNative creates and updates native views automatically. - Reactive state: Call
self.set_state(key=value)and the framework re-renders only what changed — no manual view mutation. - Virtual view tree + reconciler: Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation.
- Direct native bindings: Python calls platform APIs directly through Chaquopy and rubicon-objc, with no JavaScript bridge.
- CLI scaffolding:
pn initcreates a ready-to-run project;pn run androidandpn run iosbuild and launch your app. - Navigation: Push and pop screens with argument passing for multi-page apps.
- Bundled templates: Android Gradle and iOS Xcode templates are included — scaffolding requires no network access.
Quick Start
Installation
pip install pythonnative
Usage
import pythonnative as pn
class MainPage(pn.Page):
def __init__(self, native_instance):
super().__init__(native_instance)
self.state = {"count": 0}
def render(self):
return pn.Column(
pn.Text(f"Count: {self.state['count']}", font_size=24),
pn.Button(
"Tap me",
on_click=lambda: self.set_state(count=self.state["count"] + 1),
),
spacing=12,
padding=16,
)
Available Components
| Component | Description |
|---|---|
Text |
Display text |
Button |
Tappable button with on_click callback |
Column / Row |
Vertical / horizontal layout containers |
ScrollView |
Scrollable wrapper |
TextInput |
Text entry field with on_change callback |
Image |
Display images |
Switch |
Toggle with on_change callback |
ProgressBar |
Determinate progress (0.0–1.0) |
ActivityIndicator |
Indeterminate loading spinner |
WebView |
Embedded web content |
Spacer |
Empty space |
Documentation
Visit docs.pythonnative.com for the full documentation, including getting started guides, platform-specific instructions for Android and iOS, API reference, and working examples.
Contributing
Contributions are welcome. Please see CONTRIBUTING.md for setup instructions, coding standards, and guidelines for submitting pull requests.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythonnative-0.5.0.tar.gz.
File metadata
- Download URL: pythonnative-0.5.0.tar.gz
- Upload date:
- Size: 142.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4d27a309796b8dbe74bf980c6b8074c3d1158c81e643402ea165b3b7655db75
|
|
| MD5 |
ccc73e193de860f8e673f01c27df610a
|
|
| BLAKE2b-256 |
0c8f5f0f99529e8a33ba13b6cba4b5dfa1217e4884887e0080807d7173ae84c8
|
Provenance
The following attestation bundles were made for pythonnative-0.5.0.tar.gz:
Publisher:
release.yml on pythonnative/pythonnative
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythonnative-0.5.0.tar.gz -
Subject digest:
c4d27a309796b8dbe74bf980c6b8074c3d1158c81e643402ea165b3b7655db75 - Sigstore transparency entry: 1202643487
- Sigstore integration time:
-
Permalink:
pythonnative/pythonnative@cfe247edf99da8ff870e2d4118ef74b2df5521c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pythonnative
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cfe247edf99da8ff870e2d4118ef74b2df5521c1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pythonnative-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pythonnative-0.5.0-py3-none-any.whl
- Upload date:
- Size: 152.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a529be18e5ca16db613c894d038f77058c20fa80fc6e6301ca399705bf446f36
|
|
| MD5 |
40cfa7d9295d0c8656d5ddb43641f1cb
|
|
| BLAKE2b-256 |
77fbdddd145da07bc5b7b62ec795a6aa0bc5f698c3acc5c97b14b8b0fbd0edfa
|
Provenance
The following attestation bundles were made for pythonnative-0.5.0-py3-none-any.whl:
Publisher:
release.yml on pythonnative/pythonnative
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythonnative-0.5.0-py3-none-any.whl -
Subject digest:
a529be18e5ca16db613c894d038f77058c20fa80fc6e6301ca399705bf446f36 - Sigstore transparency entry: 1202643491
- Sigstore integration time:
-
Permalink:
pythonnative/pythonnative@cfe247edf99da8ff870e2d4118ef74b2df5521c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pythonnative
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cfe247edf99da8ff870e2d4118ef74b2df5521c1 -
Trigger Event:
push
-
Statement type: