Skip to main content

🐍 Anpyra · Python to Native Android

Write small Android apps in a typed Python subset, compile them directly to DEX, and build signed APKs. Anpyra is a Python-written compiler and build framework based on the PyAndroid experiments 001–008.

Status: v0.1 alpha. Android is the only implemented target. Native iOS, Windows, macOS and Linux backends are planned. Web is outside scope. Framework-specific device acceptance remains pending; the original experiments were reported successful on a phone.

🐍 Python-based builds

Build with Python 3.11+ and Python dependencies. No Java/JDK, Kotlin, Android SDK build kit, Android NDK, Android Studio, Gradle, D8, R8, AAPT2 or apksigner is required. cryptography is installed automatically for signing. Optional adb provides device installation.

⚡ Install the published package

Once this release is available on PyPI, use uv (recommended):

uv venv --python 3.12
uv pip install anpyra

Or use pip inside a virtual environment:

python -m pip install anpyra

Activate your environment, then:

anpyra doctor
anpyra init myapp --package dev.example.myapp --label "My App"
anpyra check myapp
anpyra build myapp
anpyra verify myapp/build/dev.example.myapp.apk

For checkout installation and host-specific commands, see the installation guide.

🧩 Application example

from anpyra import Activity, TextView


class MainActivity(Activity):
    def on_create(self, state):
        title = TextView(self)
        title.set_text("Hello from Anpyra!")
        self.set_content_view(title)

Anpyra parses application source on the host. Android runs the generated bytecode. The authoring classes provide editor support; they do not preview a UI on the host.

📦 Supported features and limits

  • One Activity, TextView construction, text and content-view calls.
  • Initialized str, int and bool locals, simple integer arithmetic and comparisons.
  • Nested conditions and typed integer helper functions.
  • DEX, binary manifest, signed APK and JSON report generation.
  • Retained project debug identity and local APK/DEX integrity checks.

This is a restricted compiler, not general Python on Android. Layouts, callbacks, arbitrary imports, collections, reassignment, multi-module apps and release/store signing are not implemented. The lifecycle currently has a 14-register local/temporary budget. See the language guide.

📚 Documentation and contribution

User guide · Developer guide · Roadmap · Issues · Contributing

Anpyra is licensed under Apache-2.0.

Metadata

Release files for anpyra 0.1.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 anpyra 0.1.0
File Size Uploaded
anpyra-0.1.0.tar.gz 120.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anpyra 0.1.0
File Interpreter ABI Platform
anpyra-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 172.4 kB

Release files / anpyra-0.1.0.tar.gz

Download URL anpyra-0.1.0.tar.gz
Size 120.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f050f0b17e85a48306ea42c75deed6e103ecbfa97e4adde1dfc489e09367b007
BLAKE2b-256 checksum
How to use checksums
6720a2278d87ff32a87ce646f167a3b415323e57d895c4cb9505cd4160c0eb1b
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 6, 2026.

Transparency log

Release files / anpyra-0.1.0-py3-none-any.whl

Download URL anpyra-0.1.0-py3-none-any.whl
Size 51.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0eebfceab1d5d1a4d342872022177bb0c9ed6e6314b64d4713b208ebea037593
BLAKE2b-256 checksum
How to use checksums
8c1775839bedd32160cb022af15b94abe6627bffe2ffe1a780360c82edfab693
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 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

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