ARKlight logoARKlight
Getting startedTutorialReferenceExamplesWhyChangelog

Start here

Getting started
Why ARKlight

Getting started

Install, write one file, build, open the result.

Install

ARKlight needs Python 3.10 or newer.

pip install arklight
arklight --version

The first

arklight

command asks you to accept the license terms once. In scripts and CI there is nobody to ask, so set

ARKLIGHT_ACCEPT_LICENSE=1

in the environment. Read the

license summary

first.

Debian and Ubuntu

There is also an APT package that installs

arklight

and registers its package source, so later updates are a plain

sudo apt update

.

curl -fsSL https://arklight-ecosystem.github.io/ARKlight/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/arklight.gpg
sudo rm -f /etc/apt/sources.list.d/arklight.list
echo "deb [signed-by=/usr/share/keyrings/arklight.gpg] https://arklight-ecosystem.github.io/ARKlight/ stable main" | sudo tee /etc/apt/sources.list.d/arklight.list
sudo apt update
sudo apt install arklight-installer

Your first site

Create

site.py

. Three things are mandatory: the

# include <stdlib.ARKlight>

line first, a

Site()

, and one

@site.page(...)

function per route that returns a

Page(...)

.

# include <stdlib.ARKlight>

site = Site()

@site.page("/")
def home():
    return Page(
        Heading("ARKlight"),
        Text("Build websites with Python."),
        Button("Get Started"),
    )

Build it

arklight build site.py

That writes plain, dependency-free HTML into

ARK/

. Pass

-o

to choose another folder and

--no-open

to stop it opening your browser.

Add some state

State belongs to the page. Put

State(...)

inside

Page(...)

as a child, show it with

Bind(...)

, and change it with an

Action

.

return Page(
    Heading("Counter"),
    State("count", 0),
    Text(Bind("count")),
    Button("Increment", on_click=Action.increment("count", 1)),
)

Where next

  • The tutorial walks through pages, components, state and styling.
  • The reference lists every component, action and CLI command.
  • arklight search <Name> prints the compiler's own schema for any component or action.

Read the

gotchas

before your first multi-file site; four of them cost most newcomers a build cycle.

LicenseChangelogGitHubPyPI

ARKlight is GPLv3 with attribution terms; sites you build are yours. Your browser is still running JavaScript. We just made Python responsible for getting it there.