I tried to publish GraphQL API of COVID19 infected person situation in Hyogo prefecture.

What kind of API did you use?

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.

Container configuration

--DB auto write container (implemented in python) --GraphQL server (implemented in Go)

However, unfortunately ... (2020/3/18)

After release Will be executed regularly python is loading Unexpected changes in excel file before スクリーンショット 2020-03-18 17.12.10.png

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. スクリーンショット 2020-03-18 17.12.24.png

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!

I fixed it and published it again! (2020/3/19)

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

Try api on Playground

Here is the relationship between the Excel table header and the GraphQL fields. スクリーンショット 2020-03-19 13.35.32.png 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

I tried to publish GraphQL API of COVID19 infected person situation in Hyogo prefecture.
I tried to publish GraphQL API of COVID 19 infected person situation in Hyogo prefecture. (Part 2)
I tried to touch the API of ebay
I tried to summarize the new coronavirus infected people in Ichikawa City, Chiba Prefecture
I tried to visualize the characteristics of new coronavirus infected person information with wordcloud
I tried to create API list.csv in Python from swagger.yaml
I tried to implement blackjack of card game in Python
I tried to create Quip API
I tried to touch Tesla's API
I tried to make an analysis base of 5 patterns in 3 years
I tried fitting the exponential function and logistics function to the number of COVID-19 positive patients in Tokyo
I tried to get the authentication code of Qiita API with Python.
I tried various patterns of date strings to be entered in pandas.to_datetime
I tried to get the movie information of TMDb API with Python
I tried to display the altitude value of DTM in a graph
I tried to implement a card game of playing cards in Python
I tried to make PyTorch model API in Azure environment using TorchServe
I tried to implement PLSA in Python
I tried to implement permutation in Python
I tried to implement PLSA in Python 2
I tried to implement ADALINE in Python
I tried to touch the COTOHA API
I tried to implement PPO in Python
I tried to make a Web API
I tried to predict Covid-19 using Darts
I tried to predict the number of people infected with coronavirus in Japan by the method of the latest paper in China
I tried to predict the number of people infected with coronavirus in consideration of the effect of refraining from going out
[Azure] I tried to create a Linux virtual machine in Azure of Microsoft Learn
I tried to notify slack of Redmine update
I tried to find 100 million digits of pi
I tried to integrate with Keras in TFv1.1
I tried to correct the keystone of the image
I tried to implement TOPIC MODEL in Python
I tried to implement selection sort in python
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!
[Linux] I learned LPIC lv1 in 10 days and tried to understand the mechanism of Linux.
I tried to notify the update of "Become a novelist" using "IFTTT" and "Become a novelist API"
I tried to extract the text in the image file using Tesseract of the OCR engine
I tried to put HULFT IoT (Agent) in the gateway Rooster of Sun Electronics
[First data science ⑥] I tried to visualize the market price of restaurants in Tokyo
I tried to graph the packages installed in Python
I tried to summarize how to use matplotlib of python
I tried to summarize the basic form of GPLVM
I tried to implement a pseudo pachislot in Python
I tried to implement Dragon Quest poker in Python
I tried to implement GA (genetic algorithm) in Python
I tried to uncover our darkness with Chatwork API
I tried using the API of the salmon data project
I tried to visualize the spacha information of VTuber
I tried to summarize how to use pandas in python
I tried to erase the negative part of Meros
[Python] I tried to get Json of squid ring 2
I tried to implement automatic proof of sequence calculation
I tried to classify the voices of voice actors
I tried to summarize the string operations of Python
I tried to display the point cloud data DB of Shizuoka prefecture with Vue + Leaflet
I tried to tabulate the number of deaths per capita of COVID-19 (new coronavirus) by country
I tried to create a Python script to get the value of a cell in Microsoft Excel
I wrote a doctest in "I tried to simulate the probability of a bingo game with Python"
I tried to put HULFT IoT (Edge Streaming) in the gateway Rooster of Sun Electronics