Skip to main content

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 on top of a native rendering core written in Swift and Kotlin. Write function components with use_state, use_effect, and friends, just like React, and let PythonNative handle creating and updating native views.

Features

  • Declarative components and hooks: Describe native UI with Python functions, immutable elements, and typed styles. State, effects, context, and suspense boundaries follow one logical application tree across screens, overlays, and mounted list rows. State updates batch automatically, effect errors reach the nearest error boundary, and event callbacks receive typed records instead of dicts.
  • React Native's core surface: Pressable, ScrollView, Text, TextInput, Image, Modal, FlatList, and SectionList carry the props a React Native developer expects (disabled state and ripples, content insets and snapping, ellipsize modes and pressable spans, controlled selection and key events, sticky headers and inverted lists), plus typed imperative handles on ref.current and the full accessibility prop set.
  • Native widgets and layout: Swift and Kotlin component managers own UIKit and Android widgets. The shared Yoga C++ engine computes layout beside the controls, using platform measurements for text and intrinsic sizes.
  • Standard asyncio: Components, effects, event handlers, and tasks run on a dedicated Python application thread. Native UI threads handle widgets, scrolling, and animation frames. Component-owned tasks are canceled on unmount.
  • Incremental reconciliation: State changes update affected component subtrees. Versioned bridge commits validate operations and acknowledge revisions; events and controlled text inputs carry identities that prevent stale updates.
  • Typed, Pythonic authoring: Components return pn.Node and their signatures are their props, so a strict type checker verifies element trees and conditional children. Screens are components whose parameters are their route params (nav.push(ItemScreen(id=42))), navigators are module-level values with deep links derived from each screen's path, one Theme dataclass styles the app and its navigators, StyleSheet namespaces give styles typed names, and pn.Store holds app state with selector-based re-renders. pn lint checks the rules of hooks.
  • Native lists and navigation: UIKit collection views and Android recycler views recycle cells for fixed or variable row sizes, grids, sections, and horizontal lists. Native navigation containers present logical screen roots at every nesting level while providers and component state remain in the shared Python tree; navigators take screen options, groups, tab-bar styles, and a navigation ref usable outside components.
  • Animation and gestures: Serialized animation graphs support timing with named or bezier easing, springs, React Native's decay model, arithmetic, interpolation, and native scroll and gesture bindings. Swift and Kotlin recognize mobile gestures with Gesture Handler-style activation offsets and update supported animation bindings without Python work on every frame.
  • Assets and graphics: Drop images, fonts, and SVGs under app/assets/ and reference them by path. Density variants, bundled fonts, a vector Icon set, Svg drawing, gradients, and blur render natively on both platforms and in the browser preview.
  • Device APIs: Python facades expose camera, location, notifications, storage, permissions, keyboard, dimensions and pixel ratio, device info, localization, accessibility settings, and other native services, with a Python fallback for headless tests. Test permissions and platform behavior on your deployment targets.
  • Native extension SDK: Python dataclasses and protocols define contracts; define_component returns a typed element factory and pn codegen generates props and module adapters for Swift and Kotlin. Plugins package native sources and resources, and builds verify matching contracts at startup.
  • Testing library: pythonnative.testing renders components headlessly with Testing Library-style queries (get_by_role, get_by_placeholder_text, within, find_by_*), a virtual clock for timers, and a pytest plugin that resets the runtime between tests.
  • PythonNative Go: a prebuilt dev client, published with each release, runs any project without native code, so the project itself is never compiled. i / a in pn start open it on the iOS Simulator (which still needs Xcode installed) or an Android emulator, and a phone with Go installed opens the project by scanning the QR code pn start prints. Go isn't in the app stores: Android phones install the APK, and iPhones need Go built and signed with your Apple team. Projects that add native code run in their own debug build, which pn run rebuilds only when something native changes.
  • DevTools and debugging: pn start serves DevTools, with a component tree showing props and hooks (and editable state), a console with a REPL inside the running app, problems with component stacks and source excerpts, network requests, and live performance with trace capture. VS Code attaches debugpy breakpoints to Python on the preview, a simulator, or a phone. On device, a dev menu (shake or Cmd+D) offers reload, an element inspector, and a performance monitor, and errors show a screen with the component stack and your source.
  • Development tools: Fast Refresh preserves compatible component state, pn lint checks the rules of hooks, and pn init scaffolds tests, type checking, debugger settings, and CI.
  • Browser preview: pn preview runs your Python application against a browser renderer with DOM widgets, Yoga WebAssembly layout, and JavaScript animation graphs. It supports iteration on application logic and UI; fonts, platform controls, and device APIs require mobile testing.
  • App packaging and dependency locks: pn run and pn build stage bundled app templates, native libraries, and Python sources. Target-specific wheel locks record dependency versions and hashes for mobile builds. Binary dependencies need compatible mobile wheels; pn deps reports target resolution.

Quick Start

Installation

Requires Python 3.13 or newer.

pip install pythonnative

Usage

import pythonnative as pn


@pn.component
def App() -> pn.Node:
    count, set_count = pn.use_state(0)
    return pn.Column(
        pn.Text(f"Count: {count}", style=pn.style(font_size=24, bold=True)),
        pn.Button(
            "Tap me",
            on_press=lambda: set_count(count + 1),
        ),
        style=pn.style(gap=12, padding=16),
    )

Develop

pn init my-app && cd my-app
pn start            # dev server: scan the QR code, or press i (iOS), a (Android), w (browser), j (DevTools)
pn run ios          # the project's own debug build, for projects that add native code
pn build ios        # standalone release artifacts

Documentation

Visit 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

Metadata

Release files for pythonnative 0.51.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonnative 0.51.0
File Size Uploaded Provenance
pythonnative-0.51.0.tar.gz 1.7 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for pythonnative 0.51.0
File
pythonnative-0.51.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pythonnative-0.51.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pythonnative-0.51.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
pythonnative-0.51.0-cp314-cp314-macosx_11_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 11.0+ x86-64 Details
pythonnative-0.51.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
pythonnative-0.51.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pythonnative-0.51.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pythonnative-0.51.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
pythonnative-0.51.0-cp313-cp313-macosx_11_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 11.0+ x86-64 Details
pythonnative-0.51.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details

Total release size: 26.2 MB

Release files / pythonnative-0.51.0.tar.gz

Download URL pythonnative-0.51.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3eb8ca2754e620515c6e481a4c4a87ffe00e20437d159fbbacf3511e24164ec7
BLAKE2b-256 checksum
How to use checksums
096bbe61b4f4cf43de458b3cc15e0de7b55ede7d4119002e8b5001135693c4fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp314-cp314-win_amd64.whl

Download URL pythonnative-0.51.0-cp314-cp314-win_amd64.whl
Size 2.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
f95994ffb40585a2c29b5592b368327cc4c6e7e928ffcc39d45873cd88f0126b
BLAKE2b-256 checksum
How to use checksums
5e534b7e1e289fd675493b0da21c3d12728608d2844909b86f19d5572293be27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pythonnative-0.51.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
79991249dce24b9f7a56dc190466e4b9e940b9a0a404fcd6a7ce1a8228fb7f22
BLAKE2b-256 checksum
How to use checksums
81eaeb8c2547acad6f7df99e1c9c77cf5579a6686cd947f6cbdb7a20b1298330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL pythonnative-0.51.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.3 MB
Tags CPython 3.14 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
3c8bd3e111edd20e0c1be13143a9d94eea16dbf2607f3b333c5e8ac1c86ddfa8
BLAKE2b-256 checksum
How to use checksums
42fcdb7b7ce28ade052ca871703c12f18ab1d9305874ef6d711c640f5c318fdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp314-cp314-macosx_11_0_x86_64.whl

Download URL pythonnative-0.51.0-cp314-cp314-macosx_11_0_x86_64.whl
Size 1.8 MB
Tags CPython 3.14 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
f62b297dcf731c5a786f81461093407113dfde3c43e47c9b11162e422d8294a6
BLAKE2b-256 checksum
How to use checksums
e5b99f69aaf83cbcaf58e391fd0b5627af0655b7714c7d27a65b9672782d9263
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL pythonnative-0.51.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
721303a7ddec7a870eccf2650f16db2656abe07361c3a169a4234998081028c0
BLAKE2b-256 checksum
How to use checksums
1e9a30c0b8f4203326b0a00a7dad5abc9387d59f92a17b0225cff64c9578edaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp313-cp313-win_amd64.whl

Download URL pythonnative-0.51.0-cp313-cp313-win_amd64.whl
Size 2.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
6c20d4f915cfcdf619bef3d03824ac39d79fb59591eff7011c3e6ae65efe3057
BLAKE2b-256 checksum
How to use checksums
ae87e256a63542b858bfe230426bbf5051773daa1fabc63c9596cbfe7d8f885e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pythonnative-0.51.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b7bebb4b13399ff154d71d8b5660e30b155f6a434513ee411f1fc461230f8367
BLAKE2b-256 checksum
How to use checksums
67b608f20037713342570a9e1c98ab73faa74610ffc57c739e2f26f46e7f6c74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL pythonnative-0.51.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 3.3 MB
Tags CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
284f1558add25e729adf656ec0e9b3789fde2c43441c3892121148b7c33d181a
BLAKE2b-256 checksum
How to use checksums
84d2c48e5fdbc6eaa90759cc937654c11597071c757a767340f9ed04c5f7f5d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp313-cp313-macosx_11_0_x86_64.whl

Download URL pythonnative-0.51.0-cp313-cp313-macosx_11_0_x86_64.whl
Size 1.8 MB
Tags CPython 3.13 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
72cae19a9224f54b18b6f7d3a3b8b4e326cd1d7914045b2f21665c4c614389f7
BLAKE2b-256 checksum
How to use checksums
0fbd20350cd4d6db2aa7784231c01394b3cd966e624a0330e200bf2f6e2417e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / pythonnative-0.51.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL pythonnative-0.51.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fad5a0ed7cbbb62e439414299096d390cc88895fc56fb43a304ef3d3adbc16bb
BLAKE2b-256 checksum
How to use checksums
04e0747539ba664288d3ed48b41a99906af1b88df28a89ecbff5c1303c451418
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for pythonnative 0.51.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for pythonnative-0.51.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.51.0 This release

11 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page