Skip to main content

An open-source, Python framework for building feature-rich apps that are fully integrated with the Writer platform.

Project description

What is Framework?

Writer Framework is an open-source framework for creating AI applications. Build user interfaces using a visual editor; write the backend code in Python.

Writer Framework is fast and flexible with a clean, easily-testable syntax. It provides separation of concerns between UI and business logic, enabling more complex applications.

Highlights

Reactive and state-driven

Writer Framework is fully state-driven and provides separation of concerns between user interface and business logic.

import writer as wf

def handle_increment(state):
    state["counter"] += 1

wf.init_state({
    "counter": 0
})

The user interface is a template, which is defined visually. The template contains reactive references to state, e.g. @{counter}, and references to event handlers, e.g. when Button is clicked, trigger handle_increment.

Flexible

  • Elements are highly customizable with no CSS required, allowing for shadows, button icons, background colors, etc.
  • HTML elements with custom CSS can be included using the HTML Element component. They can serve as containers for built-in components.

Fast

  • Event handling adds minimal overhead to your Python code (~1-2ms*).
  • Streaming (WebSockets) is used to synchronize frontend and backend states.
  • The script only runs once.
  • Non-blocking by default. Events are handled asynchronously in a thread pool running in a dedicated process.

*End-to-end figure, including DOM mutation. Tested locally on a Macbook Air M2. Measurement methodology.

Developer-friendly

  • It's all contained in a standard Python package, just one pip install away.
  • User interfaces are saved as JSON, so they can be version controlled together with the rest of the application.
  • Use your local code editor and get instant refreshes when you save your code. Alternatively, use the provided web-based editor.
  • You edit the UI while your app is running. No hitting "Preview" and seeing something completely different to what you expected.

Installation and Quickstart

Getting started with Writer Framework is easy. It works on Linux, Mac and Windows.

pip install writer
writer hello
  • The first command will install Writer Framework using pip.
  • The second command will create a demo application in the subfolder "hello" and start Writer Framework Builder, the framework's visual editor, which will be accessible via a local URL.

The following commands can be used to create, launch Writer Framework Builder and run an application.

writer create my_app
writer edit my_app
writer run my_app

Documentation

Full documentation, including how to use Writer's AI module and deployment options, is available at Writer.

About Writer

Writer is the full-stack generative AI platform for enterprises. Quickly and easily build and deploy generative AI apps with a suite of developer tools fully integrated with our platform of LLMs, graph-based RAG tools, AI guardrails, and more. Learn more at writer.com.

License

This project is licensed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

writer-0.7.5.tar.gz (8.0 MB view details)

Uploaded Source

Built Distribution

writer-0.7.5-py3-none-any.whl (8.1 MB view details)

Uploaded Python 3

File details

Details for the file writer-0.7.5.tar.gz.

File metadata

  • Download URL: writer-0.7.5.tar.gz
  • Upload date:
  • Size: 8.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for writer-0.7.5.tar.gz
Algorithm Hash digest
SHA256 7bc5411de7e3b1dc69f354177de64d71580ef6100ace1db9670ab96e62d6a089
MD5 5e3942eff952f40c023e100b57c0fc39
BLAKE2b-256 fba9aa3c2ec56c2c4abbbbd215640d5ea0442a67fdc33d06240c6e72dd960951

See more details on using hashes here.

File details

Details for the file writer-0.7.5-py3-none-any.whl.

File metadata

  • Download URL: writer-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for writer-0.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ccae9d83a00bba9bf6fdd61f271de2eacf5615c6b3b7918bfa80beb1f28c39e7
MD5 a816f214c8dcdd8ee589a997077ec647
BLAKE2b-256 937102689a7a8aded6ec30c31c89caa27224bec58dfdf591fbfdc87a98a6a694

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page