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.0.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.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dashpaan-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8444180bb05cb8ffe3894289f28829358a57ac1a33930ae80d8a75680a3cee41
MD5 9e114a222dfd7c9da80af44e28fe1048
BLAKE2b-256 b6cd2799af1aee76ce2c3ff190f48439de99683258f3a5180edfe449318cf36c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dashpaan-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66284829ede466f45699b5c0900afa9af187532cb87e580c149a1cf17bdbf544
MD5 2ed74cb8e86ea33e559e0a8ba50b0e53
BLAKE2b-256 5f068d22ffcf4e41ad4a9779cdadf2682ff8a1d2d31ccfea4c465ac69516f5a1

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