Skip to main content

nativelayout

Describe a screen in HTML-like text and get a native interface.

nativelayout is a declarative language for user interfaces.

You write a screen once, in a plain text file (.nl) that looks like HTML, and each programming language shows it with its own host. There is no WebView.

A .nl file has:

  • HTML tags you already know (div, p, button, input, img, ...);
  • {values} that your code fills in;
  • if and for lines, for conditions and repetition;
  • a <style> with simple CSS selectors.

The file only describes the screen. The logic (state and taps) stays in your own code, in a screen function.

nativelayout is a specification with implementations: Kotlin for Android, Python (this package) and JavaScript (used by the online editor). The same .nl file works unchanged in all of them.

This package is the Python implementation: a pure Python core (parser, expander, layout engine and differ) and a Kivy host that draws the screen.

Install

pip install nativelayout            # core only, pure Python, no dependencies
pip install "nativelayout[kivy]"    # core + Kivy host

Python 3.10 or newer. The host needs Kivy 2.x. On Android, package the app with buildozer (requirements = python3,kivy,nativelayout).

Example

screen.nl:

<nativelayout>
<style>
body { padding: 16px; gap: 12px; }
.mais { background-color: #2F81F7; color: white; border-radius: 20px; }
</style>
<body>
<h1>Hello, {name}</h1>
<p>Total: {n}</p>
<button class="mais">+ add</button>
</body>
</nativelayout>

main.py:

import kivy  # noqa: F401
from nativelayout import state, view, click, run_app, file_loader

def screen():
    s = state({"n": 0, "name": "world"})
    if click(".mais"):
        s["n"] += 1
    return view("screen.nl", s)

run_app(file_loader("."), app=screen)

The file describes the screen. The logic (state and taps) stays in your Python code, in a screen function.

What is in the package

  • nativelayout.core: parser, expander, layout engine, differ and the program side (state, view, click, go, value, save, ...). Pure Python.
  • nativelayout.host: the Kivy host. It draws on a canvas; it does not build platform-native views.

Everything is also available from the top level: from nativelayout import state, view, click, run_app, file_loader. The Kivy host is loaded only when you use it.

License

Mozilla Public License 2.0. Copyright (c) 2026 Adilson C. Rafael.

Metadata

Release files for nativelayout 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nativelayout 1.2.1
File Size Uploaded Provenance
nativelayout-1.2.1.tar.gz 64.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 133.7 kB

Release files / nativelayout-1.2.1.tar.gz

Download URL nativelayout-1.2.1.tar.gz
Size 64.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e82a0e4fa38daa04b2e9e9b52f788f0731fcc0713d39a44e23d14a763dbdc1a7
BLAKE2b-256 checksum
How to use checksums
257c7fc950e4039117560d9602738e714795999d4cf591afa5f3a7c1d375c058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

Release files / nativelayout-1.2.1-py3-none-any.whl

Download URL nativelayout-1.2.1-py3-none-any.whl
Size 69.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4958f0444b139db25fb727e1e2f35e9adaeac1e118441815af3aa369f7412088
BLAKE2b-256 checksum
How to use checksums
1a0da19d427597889acafabc09ed6b174cbbf1be6b87d01b666eda8a2dd42275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

Security for nativelayout 1.2.1

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nativelayout-1.2.1.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 24, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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