EksPy: a new Python framework for developing graphical user interface based PyQt5

ABSTRACT


INTRODUCTION
Graphical user interface (GUI) is a crucial component in software development.However, developing GUI can be a complex and time-consuming process, especially compared to developing the logic of the application itself.Therefore, GUI frameworks are useful tools to speed up the development process and simplify the creation of commonly used components.In this study, we propose EksPy, which is a new Python framework developed for creating GUI based on PyQt5.This framework is designed to simplify the GUI development process by providing ready-to-use components that can be easily customized to fit the needs.Additionally, EksPy also provides features that can accelerate the development process of GUI applications, allowing developers to focus on the logic of the application and not waste time creating basic components.EksPy also has comprehensive documentation and active community support, making it suitable for developing complex and advanced GUI applications created using other GUI frameworks [1]- [10].
In this research, we will further explain about EksPy, starting from the framework's architecture to the features offered.We will also show an experiment of applying EksPy in developing a simple GUI application and evaluate the performance of this framework compared to other GUI frameworks.The purpose of this paper is to show the advantages of EksPy for efficient GUI development and to provide guidance for developers who want to use EksPy in their projects.Furthermore, this paper will also discuss the additional features that EksPy offers such as database management, and the implementation of the modelview-controller (MVC) concept.Overall, EksPy is a comprehensive framework that can help Python developers create responsive, user-friendly, and visually appealing GUI applications, as well as ease the management of data and the implementation of the MVC concept that helps developers manage the application well [10]- [19].
In addition to the previously mentioned features, EksPy also provides a database management feature that allows developers to easily access and manage data.This feature uses the object-relational mapping (ORM) concept, which allows developers to work with Python objects as representations of data in the database.This makes the process of retrieving and inserting data more efficient and easy to understand compared to writing structured query language (SQL) commands manually [20]- [25].
EksPy also implements the MVC concept, which helps developers to separate the logic of the application from the view and control.This allows developers to manage and change the appearance of the application without having to make changes to the logic of the application more easily.This concept also makes the application more scalable and easier to develop by larger teams.
Overall, EksPy is a comprehensive framework that can assist Python developers in creating responsive, user-friendly, and visually appealing GUI applications, as well as facilitate data management and the implementation of the MVC concept for effective application management.The article will also elaborate more on how to use EksPy to manage databases and how the MVC concept is implemented in EksPy.With EksPy, developers can save time and effort in creating GUI applications and can focus on the design and implementation of the logic and functionality of their application.

PROPOSED FRAMEWORK
The proposed framework, EksPy, is designed to simplify the GUI development process for Python developers by providing ready-to-use components that can be easily customized to fit their needs.The framework is built on top of PyQt5, which is a powerful and flexible GUI framework.The EksPy framework is integrated with PyQt5 as its underlying technology.The Core Library, GUI elements, and layout management components of EksPy are leveraging the capabilities of PyQt5 to provide a more robust and efficient framework.EksPy provides features that can accelerate the development process of GUI applications, allowing developers to focus on the logic of the application and not waste time creating basic components.Figure 1 depicts the proposed framework comprising several key components.
Figure 1.Architecture of EksPy framework Figure 1 presents the architecture of the proposed EksPy framework, which aims to simplify the GUI development process for Python programmers.The framework is built on PyQt5 and comprises essential components such as the Core Library, GUI elements, layout management, event management, and database management, and follows the MVC concept.The Core Library provides foundational functionalities, while GUI Elements offer pre-built user interface elements for easy integration.Layout management assists in organizing GUI elements, and event management handles user interactions effectively.Database management ensures seamless integration with databases.By following the MVC concept, EksPy promotes code modularity and enhances the maintainability and extensibility of GUI applications.This architecture empowers developers by providing a robust and efficient framework for GUI application development.

Core library
This component provides the base classes and functions that are used to create the GUI elements, such as buttons, labels, and input fields.The Core library is the core component of the EksPy framework that contains all the basic features and core functions in application development.It is responsible for providing access to all the resources and features required by other components such as GUI elements, layout management, event management, and database management.
The Core Library also ensures the integrity and consistency of data throughout the application.Unique and custom features of applications built using EksPy can also be developed and added through the Core Library.This component is the most important part of the framework that ensures the performance and efficiency of the built application.

GUI elements
This component provides ready-to-use GUI elements that can be easily customized to fit the needs.GUI elements are components in the EksPy framework responsible for providing an interface between the application and the user.They include all display elements such as buttons, forms, and labels that allow the user to interact with the application.
The GUI elements are designed to provide an intuitive and user-friendly display, making the user experience of running the application easier.This component works in conjunction with the Core Library and layout management to ensure a consistent and efficient display of the application.The GUI Elements also allow developers to create custom displays and additional features as needed by the application.In EksPy, GUI elements can be easily implemented and developed, making it easier to develop applications with an attractive and user-friendly display.

Layout management
This component provides tools for managing the layout of the GUI elements.Layout management is a component within the EksPy framework responsible for organizing and arranging the visual elements within an application.It determines the placement, size, and spacing of GUI Elements such as buttons, forms, labels, and others.
The layout management component works in conjunction with the Core Library and GUI elements to ensure a consistent and efficient appearance of the application.This component provides the ability to easily adjust and modify the layout of the application, even as its content changes.This can include dynamic resizing, support for different screen sizes, and the ability to display different layouts for different devices.Layout management in EksPy also enables developers to create custom layouts and add additional features to meet the specific needs of the application.

Event management
This component provides tools for managing the events that occur in the application.Examples of event management tools include signal, slot, and event filters.Event management is a component of the EksPy framework that ensures the application can react to events such as mouse clicks, key presses, and others.It ensures that the application can respond accurately and efficiently when the user interacts with the application interface through GUI elements.Event management makes sure that every event is recognized and processed correctly so that the application can provide an appropriate and satisfactory response to the user.
This component also ensures that the events can be passed to other components such as the Core Library or database management for further processing such as updating the database or processing other data.With event management, developers can create more interactive applications with features that can be customized to meet the needs of the application.In EksPy, event management is designed to facilitate the development of applications with efficient and accurate user interaction.

Database management
This component provides tools for managing data.Using the ORM concept, it allows developers to work with Python objects as representations of data in the database.The ORM concepts are illustrated in Figure 2. Figure 2 depicts the relationship between the database and the ORM, as well as the relationship between the ORM and the Python code.ORM is a component that enables accessing and manipulating data in the database through objects in a programming language like Python.On the right side of the Then, on the left side of the figure, there is Python code that uses objects from the ORM to access and manipulate data in the database, without having to write complex SQL code.By using ORM, developers can easily access and manipulate data in the database because ORM facilitates communication between the programming language and the database.ORM also helps reduce the complexity of writing SQL code, making it easier to develop applications that interact with the database.

MVC concept
This component implements the MVC concept, which helps developers to separate the logic of the application from the view and control.This allows developers to manage and change the appearance of the application without having to make changes to the logic of the application more easily.The MVC concept is illustrated in Figure 3.The MVC architecture is a design pattern that separates an application into three components: model, view, and controller.The model contains the data and business logic of the application.The view is responsible for displaying the data from the model to the user, and it uses Pyqt5 framework to create the graphical user interface.The user interacts with the interface provided by the view.The controller receives user input and updates the model and view accordingly.
In Figure 3, the relationships between these components are depicted.The view communicates with the user by displaying information to them and receiving input.The controller receives input from the user and updates both the model and the view.The model contains the data and business logic, and it is updated by the controller based on the user input.This architecture helps to organize the code and make it easier to maintain and scale the application.
The proposed framework also provides comprehensive documentation and active community support, making it suitable for developing complex and advanced GUI applications.With EksPy, developers can save time and effort in creating GUI applications and can focus on the logic and functionality of their applications.

EXPERIMENTS
In order to comprehensively evaluate the performance of the proposed EksPy framework, a series of experiments will be conducted.These experiments will strategically target several fundamental aspects of the framework, including its ease of use, development speed, and the resulting application's performance.This rigorous assessment aims to provide a comprehensive understanding of the capabilities and advantages offered by EksPy for GUI application development.a. Ease of use: In this experiment, we will create a simple GUI application using EksPy and compare the process to creating the same application using other GUI frameworks such as Tkinter and wxPython.The experiment will focus on the ease of use of the framework, the readability of the code, and the time required to complete the development.b.Speed of development: In this experiment, we will create a more complex GUI application using EksPy and compare the process to creating the same application using other GUI frameworks such as PyGTK and PyQt.The experiment will focus on the speed of development, the number of lines of code required, and the time required to complete the development.c.Performance: In this experiment, we will measure the performance of the resulting application in terms of responsiveness, memory usage, and CPU usage.The experiment will compare the performance of the application created using EksPy to the performance of the same application created using other GUI frameworks such as PySide and PyQt.d.Database management: In this experiment, we will evaluate the performance of EksPy in terms of data management.We will create a simple application that uses EksPy's ORM feature to insert, update, and retrieve data from a database.Then we will measure the time required for each action and compare the results to other ORM libraries such as SQLAlchemy.e. MVC concept: In this experiment, we will evaluate the performance of EksPy in terms of MVC concept.
We will create a simple application that uses EksPy's MVC implementation to separate the logic, view, and control.Then we will measure the time required for each part and evaluate the maintainability of the application.All experiments will be conducted on a computer with the following specifications: Intel Core i7-8700K CPU, 16 GB DDR4 RAM, and NVIDIA GeForce GTX 1080 graphics card.The experiments will be conducted using Python version 3.11.The results will be recorded and analyzed to determine the performance of the proposed framework compared to other GUI frameworks.Pseudocode is a simple representation of a program code written in natural language or a programming language processed by humans, not machines.In this research, pseudocode has several advantages compared to actual code: Readability, Flexibility, Simplicity, and a focus on the algorithm.
Figure 4 is a pseudocode for the ease of use, speed of development, and performance experiment, where we create a more complex GUI application that displays a list of items and allows the user to add items from the list, using EksPy, Tkinter or PyQT: This experiment demonstrates that Tkinter or PyQt provides more advanced features compared to Tkinter, it has a more modern look and feel, and is more flexible in terms of layout management.PyQt also provides more extensive documentation and a large community support which can aid in the development process.This means that with PyQt, developers can create more 525 complex and advanced GUI applications with less effort and time.Figure 5 shows the GUI output of the pseudocode of Figure 4.The GUI contains a list box, an input field for adding an item, an "Add Item" button, and a "Remove Item" button.When the user enters an item in the input field and clicks the "Add Item" button or presses the "Enter" key, the item will be added to the list box.If the user selects an item in the list box and clicks the "Remove Item" button, the selected item will be removed from the list box. Figure 6  This experiment demonstrates how easy it is to use EksPy's ORM feature to interact with an SQLite database.We can define our models by inheriting the model class and declaring the columns in it.Then, we can use the provided methods like save(), get(), and create() to interact with the database.This way, the model and view are decoupled, and the controller acts as a mediator between the two.This demonstrates the use of MVC architecture in EksPy, which makes the code more organized, maintainable, and easier to scale.
Figure 7 shows the output of the pseudocode for the database management and MVC concept experiment, which involves using EksPy's ORM feature to interact with an SQLite database and implementing a simple text editor application using EksPy's MVC architecture.The figure displays the Page Home title, followed by the user's username and email information.This experiment demonstrates the ease of using EksPy's ORM feature to interact with an SQLite database, by defining models that inherit the model class and using methods like save(), get(), and create().to interact with the database.The MVC architecture used in EksPy decouples the model and view, making the code more organized, maintainable, and scalable.

RESULT AND DISCUSSION
Table 1 provides a comparison of the features of EksPy, Tkinter, and PyQt.The features include ease of use, speed of development, performance, database management, and MVC concept.The results are based on the experiments conducted in this study.The table provides an overview of the strengths and weaknesses of each framework and helps developers make an informed decision when choosing a framework for their GUI development projects.

Ease of use
EksPy is rated as high in terms of ease of use.This means that the framework requires less code, and the code is more readable, making it easier for developers to understand and write.On the other hand, Tkinter is rated as low in terms of ease of use.The EksPy framework utilizes an intuitive structure and intuitive syntax, which allows developers to write the code in a more straightforward and concise manner.This leads to a reduction in the amount of code needed to accomplish a given task, and in turn, makes it easier for developers to understand and maintain the code.Additionally, EksPy provides several convenient libraries and tools that automate various tasks, reducing the need for manual coding.
When developing using the MVC concept in EksPy, the developer will be more focused on managing the algorithms or logic in processing data without having to initially configure connecting the database and making queries.For example, without using EksPy, querying data in the database would require the creation of code like the one shown in Figure 8, which consists of 923 characters spread across 34 lines.If the MVC concept is implemented within the EksPy framework, the workflow can be simplified without the need for extensive configuration.Consequently, utilizing EksPy enables the usage of more concise code, as shown in Figure 9

Speed of development
EksPy is rated as high in terms of speed of development.This means that the framework allows developers to create a GUI application with less code and less time.Tkinter is rated as low in terms of speed of development.Table 2 shows the comparison between the development time using EksPy and Tkinter or PyQT.
Speed of development: EksPy demonstrates a high level of speed in the development process, enabling developers to create GUI applications with reduced code and time requirements.In contrast, Tkinter exhibits a comparatively lower speed of development.

Performance
EksPy is rated as high in terms of performance.The implementation process for each framework can greatly impact the overall performance of the software being developed.EksPy has been optimized to provide developers with a more streamlined experience, resulting in faster performance and shorter code compared to Tkinter and PyQT.The use of MVC design patterns in EksPy allows developers to focus on the algorithms and logic behind processing data, without having to handle the initial setup and configuration of connecting to a database and querying data.In comparison, Tkinter and PyQT may require longer code and more setup time to achieve the same results.Table 3 shows the performance results of the EksPy and Tkinter or PyQt frameworks in terms of execution speed.As shown in the table, Tkinter or PyQt has an execution time of 2135.57791ms, while EksPy has an execution time of 1774.87683ms.This indicates that EksPy is faster in running code compared to Tkinter or PyQt.Execution speed measures how fast the code runs, including the time taken to process and execute commands.The faster the execution time, the more efficient and productive the application created using the framework will be.For the performance evaluation, experiments were conducted on a computer system with specific specifications to ensure repeatability and accuracy of the results.The computer used for the evaluation was equipped with an Intel Core i7-8700K processor, 16 GB DDR4 RAM, and an NVIDIA GeForce GTX 1080 graphics card.These specifications were selected to maintain consistency and eliminate potential variations that could affect the performance comparison between EksPy and Tkinter/PyQt frameworks.Throughout the experiments, the computer settings and configurations remained constant.This approach guarantees a fair and objective evaluation of the execution speed.a. Database management EksPy is the only framework that has a built-in ORM feature.It makes it easy to interact with a database.Tkinter and PyQt do not have this feature.b.MVC concept EksPy is the only framework that follows MVC architecture.It makes it easy to separate the logic of the application and improve the maintainability of the code.Tkinter and PyQt do not follow this concept.
This study introduces EksPy, a new Python framework developed for GUI applications using PyQt5.The research demonstrates that EksPy is a powerful, user-friendly, and easy-to-use framework that offers numerous advantages over existing frameworks like Tkinter and PyQt.The experiments conducted in this study emphasize EksPy's key features, including ease of use, speed of development, performance, database management, and the MVC concept.

CONCLUSION
In conclusion, EksPy is a powerful, user-friendly, and easy-to-use framework for developing GUI applications in Python.It provides many advantages over other existing frameworks such as Tkinter and PyQt.The experiments performed in the study have highlighted the key features of EksPy: ease of use, speed of development, performance, database management, and MVC concept.EksPy's ease of use makes it an ideal choice for developers of all skill levels, from beginners to experienced professionals.The framework requires less code, and the code is more readable, making it easier to understand and write.EksPy also provides a more modern and customizable look and feel compared to Tkinter.
The speed of development is another major advantage of EksPy.The framework provides a set of pre-defined UI elements and layout management, which makes the development process much faster and more efficient than other libraries like PyQt or Tkinter.This means that developers can create more complex and advanced GUI applications with less effort and time.EksPy's performance is good, as it is built on top of PyQt which is a powerful library, and it has good performance.This makes EksPy suitable for developing high-performance GUI applications.EksPy also has a built-in ORM feature which makes it to interact with a database and it follows MVC architecture.
In summary, EksPy has several advantages for creating powerful and professional-looking GUI applications in Python.The repository of EksPy can be accessed on GitHub at https://github.com/sallieeky/pboframework.The repository contains source code, documentation, and more examples that can aid in using EksPy.


ISSN: 2088-8708 Int J Elec & Comp Eng, Vol.14, No. 1, February 2024: 520-531 522 figure, tables in the database are represented by objects in the ORM, making it easier for developers to access and manipulate data in the database.Then, on the left side of the figure, there is Python code that uses objects from the ORM to access and manipulate data in the database, without having to write complex SQL code.By using ORM, developers can easily access and manipulate data in the database because ORM facilitates communication between the programming language and the database.ORM also helps reduce the complexity of writing SQL code, making it easier to develop applications that interact with the database.

Figure 7 .
Figure 7. GUI output of the pseudocode for the database management and MVC concept


ISSN: 2088-8708 Int J Elec & Comp Eng, Vol.14, No. 1, February 2024: 520-531 530 is a pseudocode of code for the database management and MVC concept experiment, where we use EksPy's ORM feature to insert, update, and retrieve data from an SQLite database and implement a simple text editor application using EksPy's MVC architecture.

Table 2
EksPy and Tkinter or PyQt, specifically focusing on three distinct tasks: user interface development (Task 1), database integration (Task 2), and advanced features implementation (Task 3).The table showcases the time taken by each framework to complete these tasks, with EksPy accomplishing the user interface task in 10 minutes compared to Tkinter's 15 minutes, resulting in a 33.33% reduction in time.Similarly, EksPy completes the database integration task in 20 minutes compared to Tkinter's 30 minutes, representing another 33.33%-time reduction.For the advanced features task, EksPy outperforms Tkinter by completing it in 30 minutes compared to Tkinter's 40 minutes, resulting in a 25% reduction in time.Considering the average time taken across all tasks, EksPy demonstrates a 29.74% reduction in development time compared to Tkinter.These findings highlight the superior speed and efficiency of EksPy in GUI application development, emphasizing its advantages over Tkinter in terms of development time.

Table 2 .
Comparison between the development time using EksPy and Tkinter or PyQT

Table 3 .
The performance results of the EksPy and Tkinter or PyQt frameworks