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.
  • 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.
  • 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 while providers and component state remain in the shared Python tree.
  • Animation and gestures: Serialized animation graphs support timing, springs, decay, arithmetic, interpolation, and native scroll and gesture bindings. Swift and Kotlin recognize mobile gestures 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, and other native services. Test permissions and platform behavior on your deployment targets.
  • Native extension SDK: Python dataclasses and protocols define contracts; pn codegen generates props and module adapters for Swift and Kotlin. Plugins package native sources and resources, and builds verify matching contracts at startup.
  • Development tools: pn start serves the browser preview and connected mobile dev clients. Fast Refresh preserves compatible component state, while diagnostics report errors and invalid hook usage. Changes to native inputs trigger a rebuild.
  • 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():
    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(spacing=12, padding=16),
    )

Develop

pn init my-app && cd my-app
pn preview          # dev server + browser preview with Fast Refresh
pn run ios          # in another terminal: debug build that connects to the same server
pn run android
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.45.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.45.0
File Size Uploaded
pythonnative-0.45.0.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pythonnative 0.45.0
File
pythonnative-0.45.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pythonnative-0.45.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.45.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
pythonnative-0.45.0-cp314-cp314-macosx_11_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 11.0+ x86-64 Details
pythonnative-0.45.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
pythonnative-0.45.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pythonnative-0.45.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.45.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.45.0-cp313-cp313-macosx_11_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 11.0+ x86-64 Details
pythonnative-0.45.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details

Total release size: 21.9 MB

Release files / pythonnative-0.45.0.tar.gz

Download URL pythonnative-0.45.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
75956fb69551d15f8e8f2fc689db4d249ddfcbdbb116c1bdbe4b692800d70c01
BLAKE2b-256 checksum
How to use checksums
44ef65c7eb08c2c193137953277e4f698dd8c340e8e5fd89d038cb64a9b71445
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp314-cp314-win_amd64.whl
Size 1.6 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
33236a25f53f6abafb04eb1705061b87291f5f13a387d98d0c421f5448e2b7a4
BLAKE2b-256 checksum
How to use checksums
f312287b55f058dbade8941b77e383708902b778e1c25e70ae38ee99e33c2450
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.0 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
67cd5003ed0786b658798a7d9fb85ca8cfe965a660aa8057048211ead9fd2501
BLAKE2b-256 checksum
How to use checksums
8d9f0b68627ac52cc02ba29082fc72a518c52f9df6050de9a0201636fdadb3bc
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 2.9 MB
Tags CPython 3.14 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
41c2f6c9fef32fa6b0a2ba9d0e30c93c1a0c6401c14237ffa4f6b69217f9266f
BLAKE2b-256 checksum
How to use checksums
1fdb6f67020b8f2d97f797204b642c9f19d36f832b388f759cce4f855f21ad6f
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp314-cp314-macosx_11_0_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
a574fe0f94f1486bb99230f7f7d403bbdf85f0aa00d4ba110d3d8eda9905f42d
BLAKE2b-256 checksum
How to use checksums
e86dbbc548d9f67c3b7c8ed2f5751e034b0b123425ac31144c2e9f1e505bf484
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6a88e0a50e32290ec477ce89288370ad69c189f37cbd9fde84f0a77abdbc81b8
BLAKE2b-256 checksum
How to use checksums
8c45e26c1806c7c9b3cbf3408aae4016c28c327f8c1234233bbff564b9f79ae2
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp313-cp313-win_amd64.whl
Size 1.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
461dada9d8bac53e74b7ebba19f796fe167da12bdd4cf116a14c80e9d3a0a1b7
BLAKE2b-256 checksum
How to use checksums
404c587b7ea0096f4fcd280b8ea9d41ac9e0c028c58d7d7ce76edacd1200b8fe
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 3.0 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e76d51883e4815b5b314ab4910867f520364688b380e31985afcee226ef06ba5
BLAKE2b-256 checksum
How to use checksums
02b30ecd43c6776079c979102f4077c3c1f821561cc4879dda433709a4513e97
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 2.9 MB
Tags CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f37f609d5ec99aaafcaec550ff642f56660183ea633959aa29769aa4903f6772
BLAKE2b-256 checksum
How to use checksums
1b76abc989b2f289345dafb8f6c783af7c9f1924c6d5f4204a67d43b3da59220
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp313-cp313-macosx_11_0_x86_64.whl
Size 1.4 MB
Tags CPython 3.13 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
35bac67117fcececf3ee3b56bc379407f2f6cc40213edf7cf9c46ac9f8324a56
BLAKE2b-256 checksum
How to use checksums
a580d758a905e632a5ad0c3552b22665a0c925b553f09102b5e267a893622bee
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 Sep 18, 2026.

Transparency log

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

Download URL pythonnative-0.45.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
430952c71e39679ba03f5f0f387481f4cec868344a06f1f9e60e25f3d3ee94f0
BLAKE2b-256 checksum
How to use checksums
caf98dcb09def419f49383455e4620c3be8dd83267cd07b283a75a1ab117fde0
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 Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.45.0 This release

11 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

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