Skip to content

Commit

Permalink
docs: compare and update command
Browse files Browse the repository at this point in the history
  • Loading branch information
albugowy15 committed Aug 28, 2023
1 parent e1ba2a0 commit 1e2f95c
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@
## Description
This project is a part of the [Informatics FRS Helper](https://github.com/albugowy15/informatics-frs-helper) project to automatically parse all class schedule from Excel files to MySQL database.

## Supported Commands
- `update` : Parse all class data from Excel then push it to MySQL database or save it to SQL file.
- `compare` : Compare class schedule from database with latest Excel file.

## Supported Arguments

### `update` command
- `-p --push` : Optional arg to determine wether only to parse excel or also push class to DB
- `-f --file` : Required arg for path to excel file
- `-s --sheet` : Required arg for excel sheet name
- `-o --outdir` : Optional arg to write the sql statement to output directory

### `compare` command
- `-f --file` : Required arg for path to excel file
- `-s --sheet` : Required arg for excel sheet name
- `-o --outdir` : Required arg to write the comparation result to output directory

## How To Run

1. To be able to run this project, you need to have Rust installed on your computer. You can refer to the following article for instructions on how to install and configure Rust based on your operating system. [Install Rust - Rust Programming Language](https://www.rust-lang.org/tools/install).
Expand Down Expand Up @@ -47,21 +58,26 @@ This project is a part of the [Informatics FRS Helper](https://github.com/albugo
## Example
```
auto-frs-schedule --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah"
auto-frs-schedule update --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah"
```
Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Then, save the output to MySQL database.
```
auto-frs-schedule -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql
auto-frs-schedule update -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql
```
Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Then, save the output to `result/classes.sql` directory.
```
auto-frs-schedule --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql
auto-frs-schedule update --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql
```
Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Push the output to MySQL database and also save the output to `result/classes.sql` directory.
```
auto-frs-schedule compare -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/changes.txt
```
Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Compare it with existing class schedule from DB. Save the output to `result/changes.txt` directory.
## Libraries
### calamine
Calamine is a pure Rust Excel/OpenDocument Speadsheet file reader: it reads XLSX, XLS, ODS and more.
Expand Down

0 comments on commit 1e2f95c

Please sign in to comment.