Employee Information System

Create employees information system with Python data app!

Employee Information System

This application serves as an employee data management tool. It allows users to input employee information, stores it in a CSV file, and presents the data in a structured tabular format for easy access and viewing.

Data Input and Calculation

    • Data Loading: The code starts by importing the necessary libraries, setting the Streamlit page layout to a wide format, and loading an existing CSV file (’employeedb.csv’) into a Pandas DataFrame (df). This CSV file likely contains employee data, which is stored and managed within the Streamlit app.
    • Employee Registration: Within the ‘Register Staff’ section, users can input various employee details. The form fields collect information such as the employee’s first name, last name, email, gender, job title, department, date of employment, job status, and registration date. These inputs are essential for creating new employee records in the database.
    • New Employee Function: The code defines a function called new_employee, which takes the collected employee information as arguments and creates a dictionary representing a new employee record. This dictionary is then converted into a Pandas DataFrame, and this new record is concatenated with the existing employee database (df) using pd.concat.
    • Data Validation and Storage: When users submit the registration form, their input data is validated, and if everything is in order, a new employee record is added to the DataFrame. The DataFrame is then saved back to the ’employeedb.csv’ file to persistently store the updated employee data.

Data Presentation and Visualization

  1. User Interface: The Streamlit app offers a user-friendly interface for employees’ data management. Users can choose between the ‘Register Staff’ and ‘Staff Database’ sections using a sidebar selectbox.
  2. Employee Database Display: In the ‘Staff Database’ section, the entire employee database stored in the DataFrame (df) is presented as a tabular data display using st.dataframe. This allows users to view all employee records in a table format, providing a clear and organized presentation of the data.

Data Management and CSV Operations

  1. Employee Registration and Storage: The primary purpose of this Streamlit app is to facilitate employee data management. It enables users to input new employee information, which is then stored, managed, and displayed. The app handles the complexities of creating new records and ensuring data integrity.
  2. CSV File Operations: CSV files serve as a data store for employee records. The code reads data from ’employeedb.csv’ into a DataFrame and, after new registrations, updates the CSV file to reflect the changes. This demonstrates the importance of handling data storage and retrieval operations, particularly when working with external data files

In summary, the code addresses the following subtopics:

Data Input and Calculation:

  • The code loads existing employee data from a CSV file into a Pandas DataFrame.
  • User input is collected for new employee registrations, and data validation ensures accuracy.
  • Calculations such as registration date are automatically generated for each employee.

Data Presentation and Visualization:

  • The app offers an organized user interface with a sidebar selectbox for navigation.
  • The entire employee database is displayed in an interactive table using st.dataframe.

Data Management and CSV Operations:

  • Users can register new employees, and the app handles data storage and management.
  • CSV file operations are demonstrated, including reading, updating, and maintaining data consistency with external CSV files