Skip to main content

A Python library to create UIs like Streamlit but with simple syntax

Project description

<<<<<<< HEAD

Voodoo GUI

=======

Voodoo Icon

Voodoo GUI

d75fc182e04c58809afe7b9cb15fbbc48f4da97c

Voodoo GUI is a simple Python library to create user interfaces like Streamlit but with an intuitive and simpler syntax.

Installation

pip install voodoo-gui

Usage

Example code to create a simple page:

from voodoo.gui import Gui
import voodoo.gui.builder as vo

text = "Original text"

with vo.Page() as page:
<<<<<<< HEAD
    vo.text("# Getting started with voodoo GUI", mode="md")
    vo.text(f"My text: {text}")

=======
    vo.text("# Getting started with voodoo GUI", mode="big")
    vo.text(f"My text: {text}")
>>>>>>> d75fc182e04c58809afe7b9cb15fbbc48f4da97c
    vo.input(f"{text}")

Gui(page).run(debug=True)

Then run:

<<<<<<< HEAD
python voodoopy_gui_example.py
=======
python basic.py
>>>>>>> d75fc182e04c58809afe7b9cb15fbbc48f4da97c

Access the page on localhost:3000.

<<<<<<< HEAD

How it Works with A Sample

The project uses the voodoo.gui library to create a GUI with two panels:

  • Doctor Appointment Panel: Allows users to input a doctor's name and surname and submit or cancel the appointment. The information is printed to the console.
  • Patient Info Panel: Allows users to input a patient's name and surname and submit or cancel the appointment. The information is printed to the console.

=======

d75fc182e04c58809afe7b9cb15fbbc48f4da97c

Voodoo Hospital System

This project demonstrates the usage of the voodoo.gui library to build a GUI for managing doctor and patient information in a hospital system. The system allows users to input doctor and patient details and either submit or cancel these assignments.

Features

  • Doctor Appointment Panel:

    • Input fields for doctor name and surname.
    • Buttons for submitting or canceling the appointment.
  • Patient Info Panel:

    • Input fields for patient name and surname.
    • Buttons for submitting or canceling the patient appointment.

Installation

  1. Ensure you have voodoo.gui installed in your Python environment.
  2. Clone or download the project files.
git clone https://github.com/your-repository-url
cd your-project-directory

<<<<<<< HEAD
=======
## How it Works with A Sample 

The project uses the `voodoo.gui` library to create a GUI with two panels:

- **Doctor Appointment Panel**: Allows users to input a doctor's name and surname and submit or cancel the appointment. The information is printed to the console.
- **Patient Info Panel**: Allows users to input a patient's name and surname and submit or cancel the appointment. The information is printed to the console.
>>>>>>> d75fc182e04c58809afe7b9cb15fbbc48f4da97c

### Code Overview

```python
from voodoo.gui import Gui
import voodoo.gui.builder as vo

def submit(state):
    print(f"Doctor Info: {state['input1']} , {state['input2']}")

def cancel(state):
    print(f"Doctor Assignment Cancelled Info: {state['input1']} , {state['input2']}")

def submitpatient(state):
    print(f"Patient Info: {state['input3']} , {state['input4']}")

def cancelpatient(state):
    print(f"Patient Assignment Cancelled Info: {state['input3']} , {state['input4']}")

if __name__ == "__main__":
    with vo.Page() as page:
        with vo.Panel() as panel1:
<<<<<<< HEAD
            panel1.text("Doctor Appointment", mode="md") \
=======
            panel1.text("Doctor Appointment", mode="big") \
>>>>>>> d75fc182e04c58809afe7b9cb15fbbc48f4da97c
                  .input(id="input1", text="Doctor Name") \
                  .input(id="input2", text="Doctor SurName") \
                  .button("Submit", "submit") \
                  .button("Cancel", "cancel")

        page.add_panel(panel1)
        
        with vo.Panel() as panel2:
<<<<<<< HEAD
            panel2.text("Patient Info", mode="md") \
=======
            panel2.text("Patient Info", mode="big") \
>>>>>>> d75fc182e04c58809afe7b9cb15fbbc48f4da97c
                  .input(id="input3", text="Patient Name") \
                  .input(id="input4", text="Patient SurName") \
                  .button("Submit for Patient", "submitpatient") \
                  .button("Cancel Appointment", "cancelpatient")

        page.add_panel(panel2)

        page.Setup(title="System Voodoo Hospital")
    
    Gui(page).run(debug=True)

<<<<<<< HEAD

Output

Output

d75fc182e04c58809afe7b9cb15fbbc48f4da97c

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

voodoo_gui-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

voodoo_gui-0.1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file voodoo_gui-0.1.2.tar.gz.

File metadata

  • Download URL: voodoo_gui-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for voodoo_gui-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ccce5be454ca10cc033c45a174b5a24b41f51affa1504996b9eb0447fef93e47
MD5 d713ac1537523f10fd4bc392522de7a1
BLAKE2b-256 8e756dc312bdee85c3f27d7937be91c380f479081b175bf77653ca9dff44fae9

See more details on using hashes here.

File details

Details for the file voodoo_gui-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: voodoo_gui-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for voodoo_gui-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d02a2d131febfdb8aad601537d81626acde62427ae68eecf8157207437f5aaf3
MD5 09f5a63436aab483d631c6b843e51251
BLAKE2b-256 590c9857f7178909afea72a1913e833f101967612e04a4b349dc37337cfd7528

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