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 hooks and automatic reconciliation, powered by Chaquopy on Android and rubicon-objc on iOS. Write function components with use_state, use_effect, and friends, just like React, 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. - Hooks and function components: Manage state with
use_state, side effects withuse_effect, and navigation withuse_navigation, all through one consistent pattern. styleprop: Pass all visual and layout properties through a singlestyledict, composable viaStyleSheet.- 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 via the
use_navigation()hook. - Bundled templates: Android Gradle and iOS Xcode templates are included, so scaffolding requires no network access.
Quick Start
Installation
pip install pythonnative
Usage
import pythonnative as pn
@pn.component
def MainPage():
count, set_count = pn.use_state(0)
return pn.Column(
pn.Text(f"Count: {count}", style={"font_size": 24}),
pn.Button(
"Tap me",
on_click=lambda: set_count(count + 1),
),
style={"spacing": 12, "padding": 16},
)
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
Release history Release notifications | RSS feed
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.9.0.tar.gz.
File metadata
- Download URL: pythonnative-0.9.0.tar.gz
- Upload date:
- Size: 182.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44bff0a61369fab565d29a4bd0cef288b0ce3e2784904c03683702b85a5b1949
|
|
| MD5 |
be509d28550b2a18e77ddd21723d0333
|
|
| BLAKE2b-256 |
49078bbfc5c6c9b4062b4c05204a3fd5b12f78a8b8669b59f3f3d8363d8a0694
|
Provenance
The following attestation bundles were made for pythonnative-0.9.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.9.0.tar.gz -
Subject digest:
44bff0a61369fab565d29a4bd0cef288b0ce3e2784904c03683702b85a5b1949 - Sigstore transparency entry: 1321075569
- Sigstore integration time:
-
Permalink:
pythonnative/pythonnative@57179b9c3946486aac6eb37a38dbdaa8755335b2 -
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@57179b9c3946486aac6eb37a38dbdaa8755335b2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pythonnative-0.9.0-py3-none-any.whl.
File metadata
- Download URL: pythonnative-0.9.0-py3-none-any.whl
- Upload date:
- Size: 185.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c20e285515bec2140370cd51bec05a9398589615abc03f49c56f397b228b363b
|
|
| MD5 |
6b86553d1907487761d16a0ca63a3e61
|
|
| BLAKE2b-256 |
ee1ba2a127e997c837b646fe02e436d82b47fa815e4a01ded066a8ff0f74cae0
|
Provenance
The following attestation bundles were made for pythonnative-0.9.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.9.0-py3-none-any.whl -
Subject digest:
c20e285515bec2140370cd51bec05a9398589615abc03f49c56f397b228b363b - Sigstore transparency entry: 1321075667
- Sigstore integration time:
-
Permalink:
pythonnative/pythonnative@57179b9c3946486aac6eb37a38dbdaa8755335b2 -
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@57179b9c3946486aac6eb37a38dbdaa8755335b2 -
Trigger Event:
push
-
Statement type: