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 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 with use_effect, and navigation with use_navigation, all through one consistent pattern.
  • style prop: Pass all visual and layout properties through a single style dict, composable via StyleSheet.
  • Cross-platform flexbox engine: A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so flex, padding, aspect_ratio, and position: "absolute" produce the same geometry on Android and iOS.
  • 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 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

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.11.0.tar.gz (236.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.11.0-py3-none-any.whl (227.2 kB view details)

Uploaded Python 3

File details

Details for the file pythonnative-0.11.0.tar.gz.

File metadata

  • Download URL: pythonnative-0.11.0.tar.gz
  • Upload date:
  • Size: 236.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pythonnative-0.11.0.tar.gz
Algorithm Hash digest
SHA256 d82d9461cb3256886b8c90fd6d37fb9f49fe4a51b2f90bd26972ccab2e8e0d31
MD5 7802069224225210abae6ab409bc4f99
BLAKE2b-256 c005318c7b627d7e2f9b95ae538525c562b6fe530d91f455f39d135e52aa5a74

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonnative-0.11.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.11.0-py3-none-any.whl.

File metadata

  • Download URL: pythonnative-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 227.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pythonnative-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4894733870bbf1f4590c86d8328c30e3d7b562098c2881e676f79e36bf8d14d0
MD5 f0007a3cfbce414741f0c20cd36dcb75
BLAKE2b-256 c1af4bd4ccd515e69616995fe8c1c9c092108789f8b76cf1d061cf928f4a181a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonnative-0.11.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