Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anasyakubu/data-rearrangement

This project is a Python-based tool for updating missing registration numbers in a student list Excel sheet. The tool reads an Excel file, identifies rows with missing entries in the "REGISTRATION NUMBER" column, and fills them sequentially. It also uses OpenAI’s API for any additional data restructuring or formatting.
https://github.com/anasyakubu/data-rearrangement

automation pandas pip python

Last synced: about 1 month ago
JSON representation

This project is a Python-based tool for updating missing registration numbers in a student list Excel sheet. The tool reads an Excel file, identifies rows with missing entries in the "REGISTRATION NUMBER" column, and fills them sequentially. It also uses OpenAI’s API for any additional data restructuring or formatting.

Awesome Lists containing this project

README

        

---

# Student Registration Number Updater

This project is a Python-based tool for updating missing registration numbers in a student list Excel sheet. The tool reads an Excel file, identifies rows with missing entries in the "REGISTRATION NUMBER" column, and fills them sequentially. It also uses OpenAI’s API for any additional data restructuring or formatting.

## Features
- **Automated Registration Number Generation**: Fills missing entries in the "REGISTRATION NUMBER" column sequentially, using the format "HIS/24/001", "HIS/24/002", etc.
- **OpenAI API Integration**: Assists in checking data structure and formatting based on provided prompts.
- **Easy Output**: Saves the updated file with completed registration numbers to a new Excel file.

## Requirements
- Python 3.6 or later
- **Pandas** for data manipulation
- **OpenAI** API for additional data cleaning and formatting (optional)

## Setup

1. Clone the repository or download the code:
```bash
git clone
cd student-registration-updater
```

2. Install the required packages:
```bash
pip install pandas openai
```

3. Set up your OpenAI API key:
- Replace `"your_openai_api_key_here"` in the script with your actual OpenAI API key.
- You can find the key in your [OpenAI account settings](https://platform.openai.com/account/api-keys).

## Usage

1. Place your Excel file (e.g., `STUDENT LIST update.xlsx`) in the project folder.
2. Update and run the script:

```python
python update_student_registration.py
```

3. Upon execution, the script will:
- Identify missing registration numbers in the specified column.
- Sequentially fill missing numbers starting from "HIS/24/001" or the specified index.
- Use OpenAI’s API to confirm data structure and make improvements if necessary.
- Save the updated Excel sheet as `Updated_STUDENT_LIST.xlsx`.

## Troubleshooting

### Common Installation Errors

- **OSError related to `f2py.exe`**: If you see an error like `OSError: [WinError 2] The system cannot find the file specified`, this is often due to background processes interfering with installation.
- Run the command prompt as an administrator.
- Ensure all Python-related processes are closed.
- Rename any existing `f2py.exe` files in your Python directory (e.g., `C:\Python312\Scripts\`).
- Retry installation.

## Example

Here’s a prompt example that the script sends to OpenAI:

```text
"Here is a dataset with student names, registration numbers, gender, and class. Please ensure all fields are filled accurately. Missing fields should be filled sequentially in 'REGISTRATION NUMBER' starting from HIS/24/001."
```

The OpenAI API then verifies or suggests formatting updates.

## License
This project is open-source and available under the [MIT License](LICENSE).

---