Every 3 minutes Download the Excel file from ↓↓↓ https://web.pref.hyogo.lg.jp/kk03/corona_kanjyajyokyo.html Write the read data to the DB. Prepare a graphQL server in another container and distribute it.
--DB auto write container (implemented in python) --GraphQL server (implemented in Go)
After release
Will be executed regularly
python is loading
Unexpected changes in excel file
before
after
As you can see in the image, a double line represented by an empty cell has been added.
An unexpected null occurs here and an error occurs.
The Excel data cannot be written to the DB.
Well, there is no choice but to create an Excel file that the person in charge will have come up with. So, unfortunately, we can only provide the data up to March 16th. Sorry!
For experimenting with services that combine python cron and graphQL ... Because it was an api that I tried to make with about the tension I was about to give up Excel empty column problem mentioned above Nothing I think I should skip the empty columns I should have fixed it.
https://hyogo.covid19-api.ga The GraphQL playground is also open to the public. https://hyogo.covid19-api.ga/playground For the time being, the source code https://github.com/inadati/hyogo-covid19-api.services
Here is the relationship between the Excel table header and the GraphQL fields. If you throw a query like this ...
query{
readInfectedPeoples{
no
confirmed_date
age_group
sex
jurisdiction
residence
occupation
onset_date
travel_history
remarks
infected_places{
name
is_relation
}
}
}
It will come back like this. You can get a list of columns after "Certified Children's Garden" in Excel by infected_places. For more information, please check the DOCS tab of Playground.
{
"data": {
"readInfectedPeoples": [
{
"no": 86,
"confirmed_date": "2020-03-17T00:00:00Z",
"age_group": 70,
"sex": "Female",
"jurisdiction": "Itami",
"residence": "Itami Health and Welfare Office jurisdiction",
"occupation": "Unemployed",
"onset_date": "March 07",
"travel_history": "None",
"remarks": "Use Green Ars Itami Day Care, a health facility for the elderly",
"infected_places": [
{
"name": "Centers for Early Childhood Education",
"is_relation": false
},
{
"name": "Kita-Harima Medical Center",
"is_relation": false
},
{
"name": "Green Ars",
"is_relation": true
},
{
"name": "Takarazuka Daiichi Hospital",
"is_relation": false
},
{
"name": "Jinkei Hospital",
"is_relation": false
},
{
"name": "Long-term care insurance office",
"is_relation": false
},
{
"name": "Overseas travelers",
"is_relation": false
},
{
"name": "Live relations",
"is_relation": false
}
]
},
...
]
}
Recommended Posts