Metadata-Version: 2.4
Name: anpyra
Version: 0.1.0
Summary: Compile a typed Python subset directly to Android DEX and signed APKs
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/babar-xagi/Anpyra
Project-URL: Documentation, https://github.com/babar-xagi/Anpyra/tree/main/docs
Project-URL: Repository, https://github.com/babar-xagi/Anpyra
Project-URL: Issues, https://github.com/babar-xagi/Anpyra/issues
Project-URL: Changelog, https://github.com/babar-xagi/Anpyra/blob/main/CHANGELOG.md
Keywords: android,python,compiler,dex,apk,native
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=46.0.0
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# 🐍 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):

```shell
uv venv --python 3.12
uv pip install anpyra
```

Or use pip inside a virtual environment:

```shell
python -m pip install anpyra
```

Activate your environment, then:

```shell
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](https://github.com/babar-xagi/Anpyra/blob/main/docs/user_guide/installation.md).

## 🧩 Application example

```python
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](https://github.com/babar-xagi/Anpyra/blob/main/docs/user_guide/language.md).

## 📚 Documentation and contribution

[User guide](https://github.com/babar-xagi/Anpyra/tree/main/docs/user_guide) · [Developer guide](https://github.com/babar-xagi/Anpyra/tree/main/docs/developer_guide) · [Roadmap](https://github.com/babar-xagi/Anpyra/blob/main/docs/roadmap.md) · [Issues](https://github.com/babar-xagi/Anpyra/issues) · [Contributing](https://github.com/babar-xagi/Anpyra/blob/main/CONTRIBUTING.md)

Anpyra is licensed under Apache-2.0.
