Skip to main content

falk

PyPI - Version PyPI - License

falk is a Python based web framework for responsive server components. falk components hold their state cryptographically signed on the client side. This makes the server fully stateless and easy to scale.

falk components can contain business logic, HTML markup, external and inline stylesheets and scripts, can communicate with the server over HTTP REST or websockets.

Demo

Demo

# pip install uvicorn[websocket] falk
# uvicorn --app-dir=./ demo:app

from falk.components import HTML5Base
from falk.asgi import get_asgi_app


def Counter(initial_render, props, state, add_callback):

    # initialize state object
    if initial_render:
        state.update({
            "count": props.get("initial_value", 0),
        })

    # this callback gets called when the button is clicked
    # (callbacks can be sync or async)
    def increment(args):
        state["count"] += args[0]

    add_callback(increment)

    return """
        <button onclick="{{ falk.run_callback('increment', [1]) }}">
            Count: <strong>{{ state.count }}</strong>
        </button>
    """


def Index(HTML5Base=HTML5Base, Counter=Counter):
    return """
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">

        <style>
            .container {
                margin: 0 auto;
                margin-top: 2em;
            }

            button {
                padding: 5px 10px;
                margin-bottom: 10px;
            }
        </style>

        <HTML5Base title="falk Hello World">
            <div class="container">
                <h1>falk Hello World</h1>

                {% for i in range(5) %}
                    <Counter initial_value="{{ i }}" />
                    <br/>
                {% endfor %}
            </div>
        </HTML5Base>
    """


def configure_app(set_setting, add_route):
    set_setting("debug", True)

    add_route("/", Index)


app = get_asgi_app(configure_app)

Metadata

Release files for falk 0.7.2

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

Source distribution (sdist)

Source distribution for falk 0.7.2
File Size Uploaded Provenance
falk-0.7.2.tar.gz 232.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 327.1 kB

Release files / falk-0.7.2.tar.gz

Download URL falk-0.7.2.tar.gz
Size 232.6 kB
Tags Source
SHA-256 checksum
How to use checksums
af37216700a972561a5cd49b688cb667b4953d58f715d2b4fe19af62c46ff5fa
BLAKE2b-256 checksum
How to use checksums
262cbd57c2e12c9dc02dc1245d02c303ad5130cf6e0b72e5f171304819d0d00b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / falk-0.7.2-py3-none-any.whl

Download URL falk-0.7.2-py3-none-any.whl
Size 94.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5673be20e482bcf637cbd84acbc642ab56ddddc639558ebe25068688d28c1d59
BLAKE2b-256 checksum
How to use checksums
8ee7713cee6320386908e6e06d570d606b0174808ab5fe648ff32881773d3cf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for falk 0.7.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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