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 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, andSectionListcarry 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 onref.currentand 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.Nodeand 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'spath, oneThemedataclass styles the app and its navigators,StyleSheetnamespaces give styles typed names, andpn.Storeholds app state with selector-based re-renders.pn lintchecks 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 vectorIconset,Svgdrawing, 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_componentreturns a typed element factory andpn codegengenerates props and module adapters for Swift and Kotlin. Plugins package native sources and resources, and builds verify matching contracts at startup. - Testing library:
pythonnative.testingrenders 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/ainpn startopen 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 codepn startprints. 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, whichpn runrebuilds only when something native changes. - DevTools and debugging:
pn startserves 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 attachesdebugpybreakpoints 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 lintchecks the rules of hooks, andpn initscaffolds tests, type checking, debugger settings, and CI. - Browser preview:
pn previewruns 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 runandpn buildstage 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 depsreports 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
Metadata
Release files for pythonnative 0.50.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pythonnative-0.50.0.tar.gz | 1.7 MB | With provenance | Details |
Built distributions (wheels)
Total release size: 26.1 MB
Release files / pythonnative-0.50.0.tar.gz
| Download URL | pythonnative-0.50.0.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ec4c3be845b6662e6084893df189e580a2eed6fd60f77475790bae48c3c3f1f
|
|
BLAKE2b-256 checksum How to use checksums |
3f62c3f66be68aa79a26fbe65142319aec451ddc6f7c876a6956162d7c2d9241
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp314-cp314-win_amd64.whl
| Download URL | pythonnative-0.50.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b8e21fa07ea62e45b17b46a2a993b6b3e630b8a46329a3fe19f3289f92bb8b07
|
|
BLAKE2b-256 checksum How to use checksums |
1c480e16da2dd09589d0e7ffcce82ae4f6b5e220ef3a9f0cff91a9297e7ae18e
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pythonnative-0.50.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 |
7233228a055f23e1fa26ecd1a19ac6ea9c95bcaf8ef3c4f1e8dbecafd3013065
|
|
BLAKE2b-256 checksum How to use checksums |
c8cdcae06fd1c0c712516743bd3f192796acb3db1fce07654674d38739893d93
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pythonnative-0.50.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 |
be2e97b17d432b8792d025ef9a68d42ed5476ef9044a0e390e9f7dd6da14eb3d
|
|
BLAKE2b-256 checksum How to use checksums |
c3f0f516c363ce5a109bae30d0915423dd7a36ad273c5a8a4602d5c0eb314c0d
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp314-cp314-macosx_11_0_x86_64.whl
| Download URL | pythonnative-0.50.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 |
df7f23325b4a55249d97563f22403100b3786486675fc2dfef40831dab63d1e6
|
|
BLAKE2b-256 checksum How to use checksums |
acdfb4b5b64203c3c316bbfba42b51e498dfd3ff320bad43e3463b349b354b23
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pythonnative-0.50.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 |
1f5c1001f1e9d1c8d5bf7f99c6c798ea227507dc899da40bf10ebdb3d4ac13ca
|
|
BLAKE2b-256 checksum How to use checksums |
f2b8b2784eb975acecca41fdbca539074fdd3d8f875fdb0991777d4f216a8303
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp313-cp313-win_amd64.whl
| Download URL | pythonnative-0.50.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7f398a2c502e130f15ce7f61b7651384bdba1f59d313678aa1b94b0585ff02a9
|
|
BLAKE2b-256 checksum How to use checksums |
3f7fb5519fc4dac97c9e6cff020ee2d3a0a3aac82ed3edf42b043e6a607cd330
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pythonnative-0.50.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 |
f6037dbcfb326fda7d5864adc5773b26017027489a3b4da87d4e45987d605cf6
|
|
BLAKE2b-256 checksum How to use checksums |
66bdfcfabaf954945490f42ba686854df4def9de2c2f55f5b64c28ba16b73fd6
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pythonnative-0.50.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 |
6e01daa696c567839f8b243e96863cc05e65e7e368b87814ceb89cfc56af9b45
|
|
BLAKE2b-256 checksum How to use checksums |
122a41cbbc33f5a2be3e8ed3c9b500477553f5b6141b00427f29ab932bfcfd1c
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp313-cp313-macosx_11_0_x86_64.whl
| Download URL | pythonnative-0.50.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 |
e3458a77a2daff481e6bb4c050b19416f267b49814e62aef461e3ea9ee00fe1c
|
|
BLAKE2b-256 checksum How to use checksums |
5ddded04bfb2c31ab92dc5d048d6d17c944c46c1497438ac41121ef89dbc1f99
|
| 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 19, 2026.
Transparency logRelease files / pythonnative-0.50.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pythonnative-0.50.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 |
fb9b6809aa80f78241afcf4f0624913380daabeca9749e2111a99a0fca1c6e02
|
|
BLAKE2b-256 checksum How to use checksums |
2dede59a31900a9e44be1b690bda197be883691a8a6636790c27b6b52516afe1
|
| 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 19, 2026.
Transparency logSecurity for pythonnative 0.50.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.
Attestation for pythonnative-0.50.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 19, 2026.
Transparency logA 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.