Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 2: fetch data from the Factory table (in the Disfactory database) to the Location table #10

Open
yalgorithm777 opened this issue Oct 20, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@yalgorithm777
Copy link
Collaborator

yalgorithm777 commented Oct 20, 2021

In this task, you need to write a python script to fetch data from the Factory table (in the Disfactory database) to the location table. The script needs to use the operation functions developed in Task 1 to put data into the location table.

The description of the Factory table is in the "/factories/{factory_id}" section in the Disfactory API page.

IMPORTANT: make sure that you read the Coding Standards section before writing code.

IMPORTANT: open separate branches and request code reviews to merge into the main branch when the subtasks are done.

Notes:

  • For each factory in the Disfactory database in the Factory table , you need to create two rows in our location table. The first row is for year 2017, and the second row is for year 2020.
  • When writing the URL to the "source" column in our location table, put this value "https://data.csrsr.ncu.edu.tw/SP/"

Please reply to this issue if there are questions.

@yalgorithm777 yalgorithm777 added the enhancement New feature or request label Oct 20, 2021
@yalgorithm777 yalgorithm777 changed the title Task 2: add data from the Factory table (in the Disfactory database) to the location table Task 2: fetch data from the Factory table (in the Disfactory database) to the location table Oct 20, 2021
@yalgorithm777 yalgorithm777 added the help wanted Extra attention is needed label Oct 20, 2021
@yalgorithm777 yalgorithm777 changed the title Task 2: fetch data from the Factory table (in the Disfactory database) to the location table Task 2: fetch data from the Factory table (in the Disfactory database) to the Location table Nov 3, 2021
@Sourbiebie Sourbiebie self-assigned this Nov 8, 2021
@Sourbiebie
Copy link
Contributor

Sourbiebie commented Nov 11, 2021

We concluded to use CSV for data import yesterday. I'll write a script to dump data from CSV to location table.

Reasons:

  1. The current disfactory API randomly choose 100(max) locations when executing, which is not designed for data export.
  2. Spotdiff only needs data input for the first time from the government data.

@yalgorithm777 yalgorithm777 removed the help wanted Extra attention is needed label Nov 17, 2021
@Sourbiebie
Copy link
Contributor

Sourbiebie commented Nov 23, 2021

Last week we concluded to leave the table 1-1 to disfactory/factory table, the year and url is moved to Answer table. So, should we change the Notes in the description?

@yalgorithm777 Thanks for your advice!

Sourbiebie added a commit that referenced this issue Nov 27, 2021
1. Implement the location import utility
#10

2. For the ease of code review, I didn't include necessary code iimplemented in task1.
@Sourbiebie
Copy link
Contributor

Done, wait for review.

Sourbiebie referenced this issue Jan 11, 2022
Import the gold standard and location with sample CSV with headers

#14

#12
@Sourbiebie
Copy link
Contributor

8204c8a

@deeper747
Copy link
Member

A new request here🙏🏽
I noticed there is a way to filter the locations that are more likely to be newly built spots.
I anti-joined the factory data crawled respectively in 2019 and 2022, acquire a list of 9,982 spots.
spots.csv
We'll dump it into the db of disfactory.tw first (to appoint factory ID and display number ).

Also, I'll split the table into 1000 rows a file, hoping we could finish a file in two months.

@deeper747
Copy link
Member

The production table is available now (the "production" spreadsheet)
https://docs.google.com/spreadsheets/d/10PUagSg0rgy4ycLpJKvQ24fyPk_YP0hgVYVijdlmZX0/edit?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants