Skip to main content

Dashpaan is a Python package for building interactive dashboards using Flask and Django.

Project description

Dashpaan Package

Overview

Dashpaan is a Python package designed for creating dynamic dashboards and web pages with minimal code. It provides a wide range of UI components (elements) that can be easily integrated into web applications.


Elements and Attributes

Below is a detailed breakdown of all the 27 elements available in Dashpaan, their attributes, and usage examples, ensuring that all attributes (except kind and version) are covered and properly demonstrated using .json() calls.


1. Line Chart

Attributes: data, series, options

line_chart = LineChart(
    data={
        "series": [
            {"name": "week", "data": [540, 539, 527]},
            {"name": "month", "data": [1520, 1529, 1567]}
        ],
        "options": {
            "chart": {"type": "line", "height": "100%"}
        }
    }
)
print(line_chart.json())

2. Pie Chart

Attributes: title, series, labels, options

pie_chart = PieChart(
    title="Sessions by Device",
    series={"Today": [{"data": [92.8, 6.1, 1.1]}]},
    labels=["Desktop", "Mobile", "Tablet"],
    options={"chart": {"type": "pie"}}
)
print(pie_chart.json())

3. Donut Chart

Attributes: title, series, labels, options

donut_chart = DonutChart(
    title="Donut Chart Example",
    series={"Today": [{"data": [30, 50, 20]}]},
    labels=["A", "B", "C"],
    options={"chart": {"type": "donut"}}
)
print(donut_chart.json())

4. QR Code

Attributes: link, size

qr_code = QRCode(
    link="https://example.com",
    size="2*2"
)
print(qr_code.json())

5. Sticky Stat

Attributes: size, value, color, title

sticky_stat = StickyStat(
    size="small",
    value=214,
    color="red",
    title="New Issues"
)
print(sticky_stat.json())

6. Sticky Target

Attributes: size, color, data, more

sticky_target = StickyTarget(
    size="1*1",
    color="#4caf50",
    data={"Yesterday": {"name": "Tasks", "note": "Completed", "count": 21}},
    more={"icon": "create", "click": {"url": "example.com"}}
)
print(sticky_target.json())

7. Form Element Upload Image

Attributes: label, max_size, allowed_types

form_image = FormElementUploadImage(
    label="Profile Image",
    max_size=5,
    allowed_types=["jpg", "png"]
)
print(form_image.json())

8. Tabular

Attributes: tabs

tabular = Tabular(
    tabs=[
        {"title": "Tab 1", "elements": [Heading(title="Tab 1 Heading")]}
    ]
)
print(tabular.json())

9. Text Field

Attributes: placeholder, required

text_field = TextField(
    placeholder="Enter Name",
    required=True
)
print(text_field.json())

10. Button

Attributes: title, color, action

button = Button(
    title="Click Me",
    color="primary",
    action={"type": "navigate", "url": "/home"}
)
print(button.json())

11. Select

Attributes: options, multiple, label

select = Select(
    options=["Option 1", "Option 2", "Option 3"],
    multiple=True,
    label="Choose Options"
)
print(select.json())

12. Flex

Attributes: content, direction

flex = Flex(
    content=["Element 1", "Element 2"],
    direction="row"
)
print(flex.json())

13. Heading

Attributes: title, size

heading = Heading(
    title="Main Dashboard",
    size="large"
)
print(heading.json())

14. Page

Attributes: title, uri, data, variables, templates, elements, navigation

page = Page(
    title="Dashboard",
    uri="/dashboard",
    data=[],
    variables={},
    templates={},
    elements=[heading, button],
    navigation="inherit"
)
print(page.json())

15. Navigation

Attributes: items

navigation = Navigation(
    items=[
        {"title": "Home", "type": "link", "data": {"url": "/home"}},
        {"title": "About", "type": "link", "data": {"url": "/about"}}
    ]
)
print(navigation.json())

16. Text Area Editor

Attributes: name

text_area_editor = TextAreaEditor(
    name="text-area-editor"
)
print(text_area_editor.json())

17. WYSIWYG Editor

Attributes: name, content

wysiwyg_editor = WysiwygEditor(
    name="wysiwyg-editor",
    content="<p>Hello World!</p>"
)
print(wysiwyg_editor.json())

18. Card

Attributes: title, content

card = Card(
    title="Product A",
    content="Best selling product"
)
print(card.json())

19. Switch

Attributes: is_on, label

switch = Switch(
    is_on=True,
    label="Enable Feature"
)
print(switch.json())

20. Wave Chart

Attributes: data, title, color, height

wave_chart = WaveChart(
    data=[10, 20, 30],
    title="Sales Chart",
    color="blue",
    height=300
)
print(wave_chart.json())

21. Circular Distribution

Attributes: data, labels

circular_chart = CircularDistribution(
    data=[30, 40, 30],
    labels=["A", "B", "C"]
)
print(circular_chart.json())

22. Chart Comparison

Attributes: data_series, labels

chart_comparison = ChartComparison(
    data_series=[[1, 2], [3, 4]],
    labels=["A", "B"]
)
print(chart_comparison.json())

23. Information

Attributes: text, icon, color

info = Information(
    text="System Update Complete",
    icon="info",
    color="blue"
)
print(info.json())

24. Form

Attributes: title, uri, fields, buttons

form = Form(
    title="User Form",
    uri="/form",
    fields=[text_field],
    buttons=[button]
)
print(form.json())

25. Reverse Text

Attributes: text

reverse_text = ReverseText(
    text="Hello World"
)
print(reverse_text.json())

26. Page Section

Attributes: title, elements

page_section = PageSection(
    title="Section A",
    elements=[card, button]
)
print(page_section.json())

27. Statistic

Attributes: title, value

statistic = Statistic(
    title="Active Users",
    value=1200
)
print(statistic.json())

Installation

pip install dashpaan

License

This project is licensed under the MIT License.


Contribution

Feel free to fork this repository and submit pull requests for improvements.

Contact

For questions and support, reach out to connect@monirs.com.

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

dashpaan-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dashpaan-1.0.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file dashpaan-1.0.1.tar.gz.

File metadata

  • Download URL: dashpaan-1.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for dashpaan-1.0.1.tar.gz
Algorithm Hash digest
SHA256 620d0f68dd82bead293d606de11c76aaa9f7296992a0f973aead8d8a1354ad6d
MD5 d351c45eb639bd64905c20fb8d977cbf
BLAKE2b-256 f63e2e46a5690d6360fa00c7b810b1ffda5cc0938c81339c68a533037ec0480c

See more details on using hashes here.

File details

Details for the file dashpaan-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dashpaan-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for dashpaan-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f83ed4d6337e79b3b123de91e33d82f8a0c2474204fbe7c460eb9359fc1b4e1c
MD5 0fd9953fac7ab4c25d89c789691a164b
BLAKE2b-256 935dcf18fcbf6ef9b4a673cf4c2679349c3135e262bc1edafadefade730dcfdb

See more details on using hashes here.

Supported by

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