Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 121 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,121 @@
# hackathon-season2
Hackathon Challenge Season2
# Devmountain Tech Fest
> Hackathon Season2
>
> Qualifiers Round
> Transform xml employee data to sqlite with view and on-demand user query db - python3

## Team members
> We Are `mVATOR`
> - Mr.Theerawat [@sajarudth](https://github.com/sajarudth)
> - Mr.Paphavich [@thaiversion](https://github.com/thaiversion)
> - Mr.Thongrit [@badoss](https://github.com/badoss)

## Data Visualization Demo Dashboard

> - hosted website (cloudflare)
> - url[https://hackathon-season2-data-analysis.pages.dev]
> - github
> - url[https://github.com/badoss/hackathon-season2-data-analysis.git]


## Required Environment
- python 3.10.4

## How to Implement

1. clone this repository
```
git clone https://github.com/thaiversion/hackathon-season2_devmountaintechfest.git
```

2. change directory to project path
for example
```
cd hackathon-season2_devmountaintechfest
```

3. start program
description of each program is shown on below section


#### program #1 starter_transform_empdata_tosqlite.py
functionality >> convert xml file (data-devclub-1.xml) and filter data then add to sqlite db table "employee" with 3 following sqlite views
and the final save .csv which each file contain employee record group by same nationality > file format devclub_\<Nationality\>.csv
```
list of sqlite view that focus on user query perspective
1. vEMPLOYEEBYDEPT
2. vEMPLOYEEBYNATIONALITY
3. vEMPLOYEEBYREGION
```


How to run file
```
python starter_transform_empdata_tosqlite.py
```
\*sqlite db store in filename "devclub.db"
\*example screenshot db on file "./screenshot/ss_example_sqlitedb_viewnotincluded.png"
\*example screenshot script on file "./screenshot/ss_starter_transform_empdata_tosqlite.py_importxml_tosqlite.png"


#### program #2 userquery_searchby_region.py
functionality >> user ondemand script to query database, ask user for input region name on python cmd
and get retrive employee record(s) with 'REGION' field condition then display json format to user on python cmd
and save json format string to file "lastestresult_userquery_searchby_region.json"


How to run file
```
python userquery_searchby_region.py
```
then user must input some charecters to python cmd
\*valid charecter is A-Z and a-z , must not input number or any special charecter
\*result json file maybe empty cuz lastest user input is invalid then clear any result remain on .json
\*example screenshot script case found record on file "./screenshot/ss_userquery_case_found.png"
\*example screenshot script case no record return on file "./screenshot/ss_userquery_case_notfound.png"
\*example screenshot script case user input invalid charecter on file "./screenshot/ss_userquery_case_notfound.png"


#### program #3 userquery_searchby_dept.py
functionality >> user ondemand script to query database, ask user for input department name on python cmd
and get retrive employee record(s) with 'DEPT' field condition then display json format to user on python cmd
and save json format string to file "lastestresult_userquery_searchby_dept.json"


How to run file
```
python userquery_searchby_dept.py
```
then user must input some charecters to python cmd
\*valid charecter is A-Z and a-z , must not input number or any special charecter
\*result json file maybe empty cuz lastest user input is invalid then clear any result remain on .json
\*example screenshot script case found record on file "./screenshot/ss_userquery_case_found.png"
\*example screenshot script case no record return on file "./screenshot/ss_userquery_case_notfound.png"
\*example screenshot script case user input invalid charecter on file "./screenshot/ss_userquery_case_notfound.png"


#### program #4 userquery_searchby_nationality.py
functionality >> user ondemand script to query database, ask user for input nationality name on python cmd
and get retrive employee record(s) with 'NATIONALITY' field condition then display json format to user on python cmd
and save json format string to file "lastestresult_userquery_searchby_nationality.json"


How to run file
```
python userquery_searchby_nationality.py
```
then user must input some charecters to python cmd
\*valid charecter is A-Z and a-z , must not input number or any special charecter
\*result json file maybe empty cuz lastest user input is invalid then clear any result remain on .json
\*example screenshot script case found record on file "./screenshot/ss_userquery_case_found.png"
\*example screenshot script case no record return on file "./screenshot/ss_userquery_case_notfound.png"
\*example screenshot script case user input invalid charecter on file "./screenshot/ss_userquery_case_notfound.png"


## Once Again
Data Visualization Demo Dashboard is displayed on website [https://hackathon-season2-data-analysis.pages.dev]

>
> mVATOR is coming to train 🚉💪
---
Syntex Guide on GitHub [GitHub Help](https://help.github.com/articles/basic-writing-and-formatting-syntax/).
Binary file added devclub.db
Binary file not shown.
2 changes: 2 additions & 0 deletions devclub_France.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
93,UXL43IOW6OV,Honorato,Maxwell,1,1982-03-09,France,2017-02-04,Aircraft Maintenance,Airhostess,1,Europe
2 changes: 2 additions & 0 deletions devclub_Germany.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
29,CMK62UAD3VK,Rowan,Leonard,1,1974-07-15,Germany,2004-03-27,Aircraft Maintenance,Pilot,1,Ocenia
2 changes: 2 additions & 0 deletions devclub_Indonesia.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
33,EWD45RJW5YK,Carter,Velasquez,0,1967-11-23,Indonesia,2005-02-27,Flight Planning,Pilot,1,APAC
3 changes: 3 additions & 0 deletions devclub_Italy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
34,BFS82MEY3CX,Selma,Bush,0,1972-03-26,Italy,2008-10-10,Flight Attendance,Airhostess,1,USA
80,EUC74ENE9ZK,Ryan,Rush,0,1998-06-13,Italy,2019-07-31,Aircraft Maintenance,Pilot,1,Middle East
2 changes: 2 additions & 0 deletions devclub_Mexico.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
50,MRC33GHJ2KW,Calvin,Roach,1,1999-04-16,Mexico,2011-03-18,Flight Attendance,Steward,1,Europe
2 changes: 2 additions & 0 deletions devclub_Netherlands.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
23,NFH65BYM0VB,Armand,Horn,0,1987-05-24,Netherlands,2007-06-19,Aircraft Maintenance,Airhostess,1,Ocenia
2 changes: 2 additions & 0 deletions devclub_Pakistan.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
3,JUI65YBK7AF,Jada,Bender,0,1963-05-28,Pakistan,2001-02-11,Pilot,Pilot,1,Canada
2 changes: 2 additions & 0 deletions devclub_Peru.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
97,SUF73DKV4QE,Dante,Hart,0,1999-12-21,Peru,2016-02-22,Pilot,Pilot,1,Europe
2 changes: 2 additions & 0 deletions devclub_Philippines.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
66,WKV12UQC6QF,Zachery,Valentine,0,1971-06-04,Philippines,2011-08-25,Flight Attendance,Steward,1,Middle East
2 changes: 2 additions & 0 deletions devclub_Singapore.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
95,OUP31WOE2IE,Dara,Wilcox,1,1996-06-29,Singapore,2011-05-18,Flight Attendance,Airhostess,1,Canada
2 changes: 2 additions & 0 deletions devclub_Ukraine.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EMPID,PASSPORT,FIRSTNAME,LASTNAME,GENDER,BIRTHDAY,NATIONALITY,HIRED,DEPT,POSITION,STATUS,REGION
5,AZE20CSG4MU,Lillian,Reese,0,1982-12-03,Ukraine,2002-05-19,Flight Planning,Steward,1,Canada
Empty file.
Empty file.
1 change: 1 addition & 0 deletions lastestresult_userquery_searchby_region.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"REGION": "APAC", "NATIONALITY": "Indonesia", "EMPID": 33, "PASSPORT": "EWD45RJW5YK", "FIRSTNAME": "Carter", "LASTNAME": "Velasquez", "GENDER": 0, "GENDER_TEXT": "Male", "BIRTHDAY": "1967-11-23", "AGE_of_EMPLOYEE": 54, "HIRED": "2005-02-27", "AGE_of_HIRED": 17, "DEPT": "Flight Planning", "POSITION": "Pilot", "STATUS": 1, "STATUS_TEXT": "Active"}]
Binary file added screenshot/ss_demo_dashbord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/ss_userquery_case_found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/ss_userquery_case_notfound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/ss_userquery_notvalidinput.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading