Skip to main content

Experimental markup language for creating rich dashboards using Dash

Project description

dashlang

pipeline status coverage report

An experimental markup language for creating rich dashboards using Dash and Dash components.

Introduction

Dashlang is a project that offers developers a set of tools to easily create complex layouts of Dash components, using a syntax as close as possible to regular HTML. Its most simple usage allows developers to create layouts using the dashlang declarative markup format and convert the markup into a Python tree of Dash components in a simple and efficient way.

Example

Take the following snippet written in the dashlang markup format. The format tries to stay as close to HTML as possible, by using tags delimited by the < and > characters, and using opening and closing tags to declare elements.

<Div id="root-container" className="fluid-container">
  <H1 id="title" className="text-bold">This is a title</H1>
  <P>This is a simple paragraph with a very very long text</P>
</Div>

This snippet can be easily converted to a Python component tree just by calling a function

from dash import Dash
from dashlang.parsers import MarkupParser

parser = MarkupParser()

app = Dash(__name__)

with open("snippet.dml") as fp:
    app.layout = parser.parse(fp.read()).to_layout()

if __name__ == "__main__":
    app.run_server(debug=True)

Running the previous Python snippet will create a Dash application instance and load its layout from the snippet file containing the layout in markup format.

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

dashlang-0.0.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

dashlang-0.0.1-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

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