Skip to main content

Cross-platform native UI toolkit for Android and iOS

Project description

PythonNative

Build native Android and iOS apps in Python.

CI Release PyPI Version Python Versions License: MIT Docs

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 init creates a ready-to-run project; pn run android and pn run ios build 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

MIT

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

pythonnative-0.5.0.tar.gz (142.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonnative-0.5.0-py3-none-any.whl (152.1 kB view details)

Uploaded Python 3

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

Hashes for pythonnative-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c4d27a309796b8dbe74bf980c6b8074c3d1158c81e643402ea165b3b7655db75
MD5 ccc73e193de860f8e673f01c27df610a
BLAKE2b-256 0c8f5f0f99529e8a33ba13b6cba4b5dfa1217e4884887e0080807d7173ae84c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonnative-0.5.0.tar.gz:

Publisher: release.yml on pythonnative/pythonnative

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pythonnative-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a529be18e5ca16db613c894d038f77058c20fa80fc6e6301ca399705bf446f36
MD5 40cfa7d9295d0c8656d5ddb43641f1cb
BLAKE2b-256 77fbdddd145da07bc5b7b62ec795a6aa0bc5f698c3acc5c97b14b8b0fbd0edfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonnative-0.5.0-py3-none-any.whl:

Publisher: release.yml on pythonnative/pythonnative

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page