pythonnative 0.36.0__tar.gz → 0.37.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pythonnative-0.36.0/src/pythonnative.egg-info → pythonnative-0.37.0}/PKG-INFO +3 -5
- {pythonnative-0.36.0 → pythonnative-0.37.0}/README.md +2 -2
- {pythonnative-0.36.0 → pythonnative-0.37.0}/pyproject.toml +6 -7
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/__init__.py +6 -4
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/_ios_log.py +1 -1
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/alerts.py +34 -88
- pythonnative-0.37.0/src/pythonnative/bootstrap.py +90 -0
- pythonnative-0.37.0/src/pythonnative/bridge/__init__.py +306 -0
- pythonnative-0.37.0/src/pythonnative/bridge/android.py +78 -0
- pythonnative-0.37.0/src/pythonnative/bridge/codec.py +164 -0
- pythonnative-0.37.0/src/pythonnative/bridge/fake.py +236 -0
- pythonnative-0.37.0/src/pythonnative/bridge/ios.py +138 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/layout.py +65 -3
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/gestures.py +13 -10
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/hooks.py +41 -26
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/hosts/__init__.py +13 -36
- pythonnative-0.37.0/src/pythonnative/hosts/native.py +348 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/images.py +6 -5
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_modules/__init__.py +30 -29
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_modules/app_state.py +10 -6
- pythonnative-0.37.0/src/pythonnative/native_modules/battery.py +76 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/biometrics.py +44 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/camera.py +61 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/clipboard.py +48 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/desktop.py +322 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_modules/file_system.py +15 -21
- pythonnative-0.37.0/src/pythonnative/native_modules/haptics.py +71 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/linking.py +122 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/location.py +77 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/net_info.py +115 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/notifications.py +136 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/permissions.py +60 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/registry.py +513 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/secure_store.py +56 -0
- pythonnative-0.37.0/src/pythonnative/native_modules/share.py +51 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_views/__init__.py +67 -86
- pythonnative-0.37.0/src/pythonnative/native_views/bridge_backend.py +264 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/platform.py +19 -15
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/platform_metrics.py +3 -3
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/android.py +0 -3
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/builder.py +38 -16
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/config.py +12 -2
- pythonnative-0.37.0/src/pythonnative/project/plugins.py +366 -0
- pythonnative-0.37.0/src/pythonnative/py.typed +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/runtime.py +35 -203
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/sdk/__init__.py +48 -33
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/sdk/_components.py +57 -76
- pythonnative-0.37.0/src/pythonnative/storage.py +184 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/build.gradle +6 -9
- pythonnative-0.37.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +127 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +16 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/build.gradle +48 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/AndroidManifest.xml +11 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/PNBridge.kt +214 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/PythonHost.kt +20 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/animation/AnimationSpecs.kt +141 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/animation/PNAnimator.kt +249 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/JsonUtil.kt +175 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/MainThread.kt +32 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/PNLog.kt +33 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/PNRegistry.kt +82 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/PNTransaction.kt +80 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/TransactionApplier.kt +115 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/bridge/ViewRegistry.kt +74 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/BuiltinComponents.kt +35 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ButtonManager.kt +33 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ComponentManager.kt +213 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ContainerManagers.kt +69 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ControlManagers.kt +186 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/DatePickerManager.kt +123 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ImageLoader.kt +141 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ImageManager.kt +156 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ModalManager.kt +134 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/PNColor.kt +201 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/PickerManager.kt +87 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/PortalManager.kt +55 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/PressableManager.kt +122 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ScrollViewManager.kt +214 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/SegmentedControlManager.kt +113 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/StatusBarManager.kt +52 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/TabBarManager.kt +131 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/TextInputManager.kt +245 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/TextManager.kt +233 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/ViewStyler.kt +355 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/VirtualListManager.kt +179 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/WebViewManager.kt +149 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/gestures/GestureArbiter.kt +233 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/gestures/GestureCoordinator.kt +127 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/gestures/GestureRecognizers.kt +527 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/BuiltinModules.kt +73 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/DeviceModules.kt +316 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/HostModule.kt +97 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/MediaModules.kt +200 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/NativeModule.kt +135 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/NotificationsModule.kt +100 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/PermissionsModule.kt +88 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/StorageModules.kt +89 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/modules/SystemModules.kt +178 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/plugins/GeneratedPlugins.kt +16 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/screens/Navigator.kt +116 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/screens/PNScreenFragment.kt +223 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/screens/ScreenRegistry.kt +80 -0
- {pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template → pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views}/PNAccessibilityDelegate.kt +5 -4
- {pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template → pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views}/PNBorderDrawable.kt +12 -3
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views/PNEditText.kt +18 -0
- {pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template → pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views}/PNFrameLayout.kt +9 -10
- {pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template → pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views}/PNVirtualListView.java +9 -12
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/test/java/com/pythonnative/runtime/AnimationSpecsTest.kt +75 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/test/java/com/pythonnative/runtime/GestureArbiterTest.kt +197 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/test/java/com/pythonnative/runtime/PNColorTest.kt +47 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/test/java/com/pythonnative/runtime/PNTransactionTest.kt +78 -0
- pythonnative-0.37.0/src/pythonnative/templates/android_template/pythonnative/src/test/java/com/pythonnative/runtime/PromiseTest.kt +75 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/settings.gradle +1 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Package.swift +21 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Animation/PNAnimator.swift +301 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Bridge/PNBridge.swift +191 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Bridge/PNRegistry.swift +140 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Bridge/PNTransaction.swift +165 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Bridge/PNViewRegistry.swift +53 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNButtonManagers.swift +206 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNColor.swift +173 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNComponentManager.swift +183 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNContainerView.swift +56 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNControlManagers.swift +281 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNImageManager.swift +221 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNOverlayManagers.swift +243 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNPressableManager.swift +114 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNScrollViewManager.swift +197 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNTabBarManager.swift +106 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNTextInputManager.swift +289 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNTextManager.swift +230 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNTransform.swift +82 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNViewManager.swift +86 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNViewState.swift +87 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNViewStyler.swift +340 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNVirtualListManager.swift +257 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNWebViewManager.swift +124 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Gestures/PNGestureCoordinator.swift +260 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/AlertModule.swift +92 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/HostModule.swift +158 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/LifecycleModules.swift +174 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/MediaModules.swift +177 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/PNNativeModule.swift +125 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/PermissionModules.swift +251 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/SystemModules.swift +251 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Plugins/PNPluginRegistration.swift +8 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Screens/PNScreenRegistry.swift +46 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Screens/PNViewController.swift +251 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Support/PNCompat.swift +46 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Support/PNJSON.swift +173 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Support/PNLog.swift +47 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Support/PNWindow.swift +51 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Tests/PythonNativeKitTests/PNColorTests.swift +50 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Tests/PythonNativeKitTests/PNGestureTests.swift +101 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Tests/PythonNativeKitTests/PNManagerTests.swift +124 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Tests/PythonNativeKitTests/PNModuleTests.swift +98 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/PythonNativeKit/Tests/PythonNativeKitTests/PNTransactionTests.swift +91 -0
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +51 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +4 -4
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/PythonRuntime.swift +38 -46
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +11 -16
- pythonnative-0.37.0/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +29 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +47 -1
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/utils.py +4 -82
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/virtual_rows.py +3 -3
- {pythonnative-0.36.0 → pythonnative-0.37.0/src/pythonnative.egg-info}/PKG-INFO +3 -5
- pythonnative-0.37.0/src/pythonnative.egg-info/SOURCES.txt +309 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative.egg-info/requires.txt +0 -3
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_animated.py +2 -2
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_animated_graph.py +3 -3
- pythonnative-0.37.0/tests/test_bridge.py +544 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_hosts.py +3 -74
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_metric_hooks.py +11 -9
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_native_lists.py +4 -4
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_native_modules.py +39 -26
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_new_components.py +1 -1
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_sdk.py +56 -74
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_storage.py +5 -9
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_utils.py +1 -1
- pythonnative-0.36.0/src/pythonnative/hosts/android.py +0 -269
- pythonnative-0.36.0/src/pythonnative/hosts/ios.py +0 -404
- pythonnative-0.36.0/src/pythonnative/native_modules/battery.py +0 -140
- pythonnative-0.36.0/src/pythonnative/native_modules/biometrics.py +0 -157
- pythonnative-0.36.0/src/pythonnative/native_modules/camera.py +0 -337
- pythonnative-0.36.0/src/pythonnative/native_modules/clipboard.py +0 -143
- pythonnative-0.36.0/src/pythonnative/native_modules/haptics.py +0 -181
- pythonnative-0.36.0/src/pythonnative/native_modules/linking.py +0 -235
- pythonnative-0.36.0/src/pythonnative/native_modules/location.py +0 -229
- pythonnative-0.36.0/src/pythonnative/native_modules/net_info.py +0 -225
- pythonnative-0.36.0/src/pythonnative/native_modules/notifications.py +0 -357
- pythonnative-0.36.0/src/pythonnative/native_modules/permissions.py +0 -224
- pythonnative-0.36.0/src/pythonnative/native_modules/secure_store.py +0 -193
- pythonnative-0.36.0/src/pythonnative/native_modules/share.py +0 -156
- pythonnative-0.36.0/src/pythonnative/native_views/android.py +0 -3702
- pythonnative-0.36.0/src/pythonnative/native_views/ios.py +0 -5253
- pythonnative-0.36.0/src/pythonnative/storage.py +0 -409
- pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +0 -259
- pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/Navigator.kt +0 -43
- pythonnative-0.36.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -154
- pythonnative-0.36.0/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -93
- pythonnative-0.36.0/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +0 -159
- pythonnative-0.36.0/src/pythonnative.egg-info/SOURCES.txt +0 -200
- {pythonnative-0.36.0 → pythonnative-0.37.0}/LICENSE +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/setup.cfg +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/animated.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/appearance.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/cli/pn.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/component.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/_base.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/controls.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/lists.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/media.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/overlays.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/pressable.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/structural.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/components/text.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/diagnostics.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/events.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/hosts/base.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/hosts/desktop.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/hot_reload.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/layout.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/mutations.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_views/base.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/native_views/desktop.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/container.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/handle.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/hooks.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/host.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/linking.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/navigators.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/screen.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/navigation/state.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/net.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/preview.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/devices.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/doctor.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/icons.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/ios.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/permissions.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/project/runtime_assets.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/boundaries.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/children.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/core.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/layout_pass.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/reconciler/vnode.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/scheduler.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/suspense.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template/BridgingHeader.h +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/testing/__init__.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/testing/backend.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative/testing/harness.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_alert.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_appearance.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_async_hooks.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_cli.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_components.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_core_semantics.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_desktop_backend.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_element.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_events.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_extended_components.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_gesture_composition.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_gestures.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_hooks.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_hot_reload.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_images.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_incremental_render.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_interaction_props.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_layout.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_mutations.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_native_views.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_navigation.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_net.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_platform.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_reconciler.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_ref.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_runtime.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_style.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_suspense.py +0 -0
- {pythonnative-0.36.0 → pythonnative-0.37.0}/tests/test_transitions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonnative
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.37.0
|
|
4
4
|
Summary: Cross-platform native UI toolkit for Android and iOS
|
|
5
5
|
Author: Owen Carey
|
|
6
6
|
License: MIT License
|
|
@@ -44,8 +44,6 @@ License-File: LICENSE
|
|
|
44
44
|
Requires-Dist: requests>=2.31.0
|
|
45
45
|
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
46
46
|
Requires-Dist: typing_extensions>=4.4; python_version < "3.11"
|
|
47
|
-
Provides-Extra: ios
|
|
48
|
-
Requires-Dist: rubicon-objc<0.5.0,>=0.4.6; extra == "ios"
|
|
49
47
|
Provides-Extra: build
|
|
50
48
|
Requires-Dist: Pillow>=10.0; extra == "build"
|
|
51
49
|
Dynamic: license-file
|
|
@@ -78,7 +76,7 @@ Dynamic: license-file
|
|
|
78
76
|
|
|
79
77
|
## Overview
|
|
80
78
|
|
|
81
|
-
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
|
|
79
|
+
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.
|
|
82
80
|
|
|
83
81
|
## Features
|
|
84
82
|
|
|
@@ -94,7 +92,7 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
94
92
|
- **Native-driven animations:** The `Animated` API (timing / spring / decay / loop / stagger, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest. `interpolate`, arithmetic operators on animated nodes, `Animated.event` scroll binding, and `diff_clamp` cover the scroll-driven patterns (collapsing headers, parallax) that define native feel.
|
|
95
93
|
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and desktop. Compose them with `Race`, `Exclusive`, and `Simultaneous` for cross-gesture arbitration (single vs. double tap, drag vs. long press).
|
|
96
94
|
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view: uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
97
|
-
- **
|
|
95
|
+
- **Native rendering core:** each commit is one serialized transaction applied by Swift and Kotlin component managers, the same shape as React Native's Fabric. Device APIs are native modules registered by name (TurboModules-style), callable from thin Python facades.
|
|
98
96
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
99
97
|
- **CLI scaffolding:** `pn init` creates a ready-to-run project; `pn run android` and `pn run ios` build and launch your app.
|
|
100
98
|
- **Instant desktop preview:** `pn preview` renders your app in a native desktop window via Tkinter with Fast Refresh on every save: iterate on layout, state, and navigation in milliseconds without booting a simulator or device. The reconciler, hooks, layout engine, and navigation are the same code that ships to the phone.
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
## Overview
|
|
28
28
|
|
|
29
|
-
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
|
|
29
|
+
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.
|
|
30
30
|
|
|
31
31
|
## Features
|
|
32
32
|
|
|
@@ -42,7 +42,7 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
42
42
|
- **Native-driven animations:** The `Animated` API (timing / spring / decay / loop / stagger, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest. `interpolate`, arithmetic operators on animated nodes, `Animated.event` scroll binding, and `diff_clamp` cover the scroll-driven patterns (collapsing headers, parallax) that define native feel.
|
|
43
43
|
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and desktop. Compose them with `Race`, `Exclusive`, and `Simultaneous` for cross-gesture arbitration (single vs. double tap, drag vs. long press).
|
|
44
44
|
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view: uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
45
|
-
- **
|
|
45
|
+
- **Native rendering core:** each commit is one serialized transaction applied by Swift and Kotlin component managers, the same shape as React Native's Fabric. Device APIs are native modules registered by name (TurboModules-style), callable from thin Python facades.
|
|
46
46
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
47
47
|
- **CLI scaffolding:** `pn init` creates a ready-to-run project; `pn run android` and `pn run ios` build and launch your app.
|
|
48
48
|
- **Instant desktop preview:** `pn preview` renders your app in a native desktop window via Tkinter with Fast Refresh on every save: iterate on layout, state, and navigation in milliseconds without booting a simulator or device. The reconciler, hooks, layout engine, and navigation are the same code that ships to the phone.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.37.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -30,9 +30,6 @@ dependencies = [
|
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
[project.optional-dependencies]
|
|
33
|
-
ios = [
|
|
34
|
-
"rubicon-objc>=0.4.6,<0.5.0",
|
|
35
|
-
]
|
|
36
33
|
build = [
|
|
37
34
|
"Pillow>=10.0",
|
|
38
35
|
]
|
|
@@ -47,9 +44,10 @@ dev = [
|
|
|
47
44
|
"pytest>=8.0",
|
|
48
45
|
"pytest-asyncio>=0.23",
|
|
49
46
|
"Pillow>=10.0",
|
|
50
|
-
# `pn run ios` shells out to `sys.executable -m pip` to vendor
|
|
51
|
-
#
|
|
52
|
-
# path. `uv sync` does not seed pip the way
|
|
47
|
+
# `pn run ios` shells out to `sys.executable -m pip` to vendor the
|
|
48
|
+
# app's [requirements].packages (project/builder.py), and the test
|
|
49
|
+
# suite exercises that path. `uv sync` does not seed pip the way
|
|
50
|
+
# `uv venv --seed` did.
|
|
53
51
|
"pip>=24.0",
|
|
54
52
|
]
|
|
55
53
|
docs = [
|
|
@@ -92,6 +90,7 @@ license-files = ["LICENSE*"]
|
|
|
92
90
|
# Include template directories inside the package so importlib.resources can find them
|
|
93
91
|
[tool.setuptools.package-data]
|
|
94
92
|
pythonnative = [
|
|
93
|
+
"py.typed",
|
|
95
94
|
"templates/**",
|
|
96
95
|
]
|
|
97
96
|
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
PythonNative is a cross-platform toolkit that turns Python ``@component``
|
|
4
4
|
functions into real, native Android and iOS views. The component model
|
|
5
|
-
is React-like (function components plus hooks)
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
is React-like (function components plus hooks). Python owns the
|
|
6
|
+
component tree, reconciliation, and layout; each commit crosses once
|
|
7
|
+
into a native rendering core (Swift ``PythonNativeKit`` on iOS, the
|
|
8
|
+
Kotlin ``pythonnative`` module on Android) that owns every platform
|
|
9
|
+
view, gesture, animation, and device API. There is no JavaScript.
|
|
8
10
|
|
|
9
11
|
Key building blocks:
|
|
10
12
|
|
|
@@ -60,7 +62,7 @@ Example:
|
|
|
60
62
|
```
|
|
61
63
|
"""
|
|
62
64
|
|
|
63
|
-
__version__ = "0.
|
|
65
|
+
__version__ = "0.37.0"
|
|
64
66
|
|
|
65
67
|
from . import appearance, diagnostics, gestures, images, runtime, sdk
|
|
66
68
|
from .alerts import Alert
|
|
@@ -14,7 +14,7 @@ straight to fd 2 is a small, reliable fix: fd 2 *is* visible to
|
|
|
14
14
|
`simctl` (that is exactly how `NSLog` reaches the terminal), so
|
|
15
15
|
Python output lands next to the Swift logs with correct ordering.
|
|
16
16
|
|
|
17
|
-
This module is intentionally self-contained (no
|
|
17
|
+
This module is intentionally self-contained (no bridge or
|
|
18
18
|
platform-specific C bindings required), so it is safe to import
|
|
19
19
|
early during `pythonnative` package initialization.
|
|
20
20
|
"""
|
|
@@ -30,77 +30,42 @@ Example:
|
|
|
30
30
|
|
|
31
31
|
from __future__ import annotations
|
|
32
32
|
|
|
33
|
-
import asyncio
|
|
34
33
|
from typing import Any, Dict, List, Optional, Sequence
|
|
35
34
|
|
|
36
|
-
from .
|
|
37
|
-
from .runtime import resolve_future
|
|
35
|
+
from .native_modules.registry import native_module
|
|
38
36
|
|
|
39
37
|
# ======================================================================
|
|
40
38
|
# Internal dispatch helpers
|
|
41
39
|
# ======================================================================
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
def
|
|
42
|
+
async def _present(
|
|
45
43
|
*,
|
|
46
44
|
title: str,
|
|
47
45
|
message: Optional[str],
|
|
48
46
|
buttons: List[Dict[str, Any]],
|
|
49
47
|
style: str,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"""Route an alert request to the active platform presenter.
|
|
48
|
+
) -> int:
|
|
49
|
+
"""Ask the native ``Alert`` module to present and await the chosen index.
|
|
53
50
|
|
|
54
51
|
``buttons`` is a list of ``{"label": str, "style":
|
|
55
|
-
"default"|"cancel"|"destructive"}`` dicts. The
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
"default"|"cancel"|"destructive"}`` dicts. The module resolves with
|
|
53
|
+
the index the user picked, or ``-1`` if the dialog was dismissed
|
|
54
|
+
without a selection. Off device the
|
|
55
|
+
[`DesktopAlert`][pythonnative.native_modules.desktop.DesktopAlert]
|
|
56
|
+
implementation records the call and answers from the queue set by
|
|
57
|
+
[`Alert.set_test_response`][pythonnative.alerts.Alert.set_test_response].
|
|
59
58
|
"""
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)
|
|
71
|
-
return
|
|
72
|
-
except Exception:
|
|
73
|
-
on_result(-1)
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
if Platform.is_android:
|
|
77
|
-
try:
|
|
78
|
-
from .native_views.android import _present_alert as _android_present_alert
|
|
79
|
-
|
|
80
|
-
_android_present_alert(
|
|
81
|
-
title=title,
|
|
82
|
-
message=message,
|
|
83
|
-
buttons=buttons,
|
|
84
|
-
style=style,
|
|
85
|
-
on_result=on_result,
|
|
86
|
-
)
|
|
87
|
-
return
|
|
88
|
-
except Exception:
|
|
89
|
-
on_result(-1)
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
# Test backend: record the call so unit tests can assert on it,
|
|
93
|
-
# then deliver the configured response.
|
|
94
|
-
Alert._test_log.append(
|
|
95
|
-
{
|
|
96
|
-
"title": title,
|
|
97
|
-
"message": message,
|
|
98
|
-
"buttons": list(buttons),
|
|
99
|
-
"style": style,
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
response = Alert._next_test_response()
|
|
103
|
-
on_result(response)
|
|
59
|
+
try:
|
|
60
|
+
result = await native_module("Alert").call_async(
|
|
61
|
+
"present", title=title, message=message, buttons=buttons, style=style
|
|
62
|
+
)
|
|
63
|
+
except Exception:
|
|
64
|
+
return -1
|
|
65
|
+
try:
|
|
66
|
+
return int(result)
|
|
67
|
+
except (TypeError, ValueError):
|
|
68
|
+
return -1
|
|
104
69
|
|
|
105
70
|
|
|
106
71
|
# ======================================================================
|
|
@@ -170,13 +135,14 @@ class Alert:
|
|
|
170
135
|
[`choose`][pythonnative.alerts.Alert.choose] and ``await``
|
|
171
136
|
the result.
|
|
172
137
|
"""
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
138
|
+
try:
|
|
139
|
+
native_module("Alert").call(
|
|
140
|
+
"show", title=title, message=message, buttons=[{"label": button, "style": "default"}], style="alert"
|
|
141
|
+
)
|
|
142
|
+
except Exception:
|
|
143
|
+
from . import diagnostics
|
|
144
|
+
|
|
145
|
+
diagnostics.swallowed("alerts.Alert.show")
|
|
180
146
|
|
|
181
147
|
@staticmethod
|
|
182
148
|
async def confirm(
|
|
@@ -206,13 +172,7 @@ class Alert:
|
|
|
206
172
|
await save()
|
|
207
173
|
```
|
|
208
174
|
"""
|
|
209
|
-
|
|
210
|
-
future: asyncio.Future[bool] = loop.create_future()
|
|
211
|
-
|
|
212
|
-
def _on_result(index: int) -> None:
|
|
213
|
-
resolve_future(future, index == 1)
|
|
214
|
-
|
|
215
|
-
_dispatch_alert(
|
|
175
|
+
index = await _present(
|
|
216
176
|
title=title,
|
|
217
177
|
message=message,
|
|
218
178
|
buttons=[
|
|
@@ -220,9 +180,8 @@ class Alert:
|
|
|
220
180
|
{"label": confirm_label, "style": "default"},
|
|
221
181
|
],
|
|
222
182
|
style="alert",
|
|
223
|
-
on_result=_on_result,
|
|
224
183
|
)
|
|
225
|
-
return
|
|
184
|
+
return index == 1
|
|
226
185
|
|
|
227
186
|
@staticmethod
|
|
228
187
|
async def choose(
|
|
@@ -265,9 +224,6 @@ class Alert:
|
|
|
265
224
|
if not options:
|
|
266
225
|
raise ValueError("Alert.choose requires at least one option")
|
|
267
226
|
|
|
268
|
-
loop = asyncio.get_running_loop()
|
|
269
|
-
future: asyncio.Future[Optional[str]] = loop.create_future()
|
|
270
|
-
|
|
271
227
|
destructive = set(destructive_labels)
|
|
272
228
|
buttons: List[Dict[str, Any]] = [
|
|
273
229
|
{
|
|
@@ -279,20 +235,10 @@ class Alert:
|
|
|
279
235
|
if cancel_label is not None:
|
|
280
236
|
buttons.append({"label": cancel_label, "style": "cancel"})
|
|
281
237
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
resolve_future(future, None)
|
|
287
|
-
|
|
288
|
-
_dispatch_alert(
|
|
289
|
-
title=title,
|
|
290
|
-
message=message,
|
|
291
|
-
buttons=buttons,
|
|
292
|
-
style=style,
|
|
293
|
-
on_result=_on_result,
|
|
294
|
-
)
|
|
295
|
-
return await future
|
|
238
|
+
index = await _present(title=title, message=message, buttons=buttons, style=style)
|
|
239
|
+
if 0 <= index < len(options):
|
|
240
|
+
return options[index]
|
|
241
|
+
return None
|
|
296
242
|
|
|
297
243
|
|
|
298
244
|
__all__ = ["Alert"]
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Entry point the native app templates run right after Python starts.
|
|
2
|
+
|
|
3
|
+
Both templates execute one line of Python once the interpreter is up:
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
import pythonnative.bootstrap; pythonnative.bootstrap.start()
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
[`start`][pythonnative.bootstrap.start] connects the two halves of the
|
|
10
|
+
bridge (installing the native -> Python callback on iOS), verifies the
|
|
11
|
+
protocol version, routes ``print()`` to the console on iOS, and warms
|
|
12
|
+
the asyncio runtime. From then on the native runtime drives everything
|
|
13
|
+
through ``callback("host", ...)``; see ``docs/concepts/bridge.md``.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import os
|
|
19
|
+
import sys
|
|
20
|
+
import traceback
|
|
21
|
+
from typing import Any, Dict
|
|
22
|
+
|
|
23
|
+
__all__ = ["start", "status"]
|
|
24
|
+
|
|
25
|
+
_started: Dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def start(dev: bool = False, strict: bool = False) -> Dict[str, Any]:
|
|
29
|
+
"""Connect the bridge and prepare the runtime.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
dev: Enable dev mode (RedBox, validation warnings). Debug
|
|
33
|
+
templates pass ``True``; hot reload turns it on as well.
|
|
34
|
+
strict: Re-raise the failure after recording it. The templates
|
|
35
|
+
pass ``True`` so a broken bridge surfaces as a bootstrap
|
|
36
|
+
error screen with the full traceback.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
A status dict (``{"protocol": 1, "platform": "ios"}``) that the
|
|
40
|
+
template logs. Unless ``strict`` is set this never raises:
|
|
41
|
+
failures are printed and reported in the dict under
|
|
42
|
+
``"error"``.
|
|
43
|
+
"""
|
|
44
|
+
global _started
|
|
45
|
+
if _started and "error" not in _started:
|
|
46
|
+
return dict(_started)
|
|
47
|
+
status_: Dict[str, Any] = {"platform": None, "protocol": None}
|
|
48
|
+
try:
|
|
49
|
+
from .utils import IS_ANDROID, IS_IOS
|
|
50
|
+
|
|
51
|
+
status_["platform"] = "ios" if IS_IOS else "android" if IS_ANDROID else "off-device"
|
|
52
|
+
if IS_IOS:
|
|
53
|
+
try:
|
|
54
|
+
from . import _ios_log
|
|
55
|
+
|
|
56
|
+
_ios_log.install()
|
|
57
|
+
except Exception:
|
|
58
|
+
pass
|
|
59
|
+
from . import bridge
|
|
60
|
+
|
|
61
|
+
status_["protocol"] = bridge.handshake()
|
|
62
|
+
if dev or os.environ.get("PN_DEV") in ("1", "true"):
|
|
63
|
+
from . import diagnostics
|
|
64
|
+
|
|
65
|
+
diagnostics.set_dev_mode(True)
|
|
66
|
+
# Create the guest loop now so the first pump request has a
|
|
67
|
+
# loop to drive and effects can schedule work during mount.
|
|
68
|
+
from .runtime import get_loop
|
|
69
|
+
|
|
70
|
+
get_loop()
|
|
71
|
+
# Import the view backend eagerly: on a slow device the first
|
|
72
|
+
# commit shouldn't also pay for importing the reconciler.
|
|
73
|
+
from .native_views import get_registry
|
|
74
|
+
|
|
75
|
+
get_registry()
|
|
76
|
+
except Exception as exc:
|
|
77
|
+
status_["error"] = f"{type(exc).__name__}: {exc}"
|
|
78
|
+
print(f"[pn.bootstrap] start failed: {exc!r}", file=sys.stderr)
|
|
79
|
+
traceback.print_exc()
|
|
80
|
+
_started = status_
|
|
81
|
+
if strict:
|
|
82
|
+
raise
|
|
83
|
+
return dict(status_)
|
|
84
|
+
_started = status_
|
|
85
|
+
return dict(status_)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def status() -> Dict[str, Any]:
|
|
89
|
+
"""Return the result of the last [`start`][pythonnative.bootstrap.start] (empty before it ran)."""
|
|
90
|
+
return dict(_started)
|