Code Monkey home page Code Monkey logo

Comments (5)

neisor avatar neisor commented on May 26, 2024

+1 for this issue.

The wrong encoding can pose issues when someone will be using the raw data and filter them since some of the special characters in names of some cities/villages are misinterpreted.
In case of need, I can create a Python script which would just perform a simple search and replace automatically to the CSV file. But this would need to be started manually by the user which is not the best-case scenario.

@matejmisik if you (or your team), because of whatever reason, are unable to fix the data before uploading them here, on GitHub, please, let me know and I'll create a simple Python script to fix the data.

from covid19-data.

sakonn avatar sakonn commented on May 26, 2024

Hello,

it seems that encoding is still malformed and not easily readable.
@neisor have you find a way to read this data automaticaly and reliably?

from covid19-data.

achjaj avatar achjaj commented on May 26, 2024

(English text follows)

Zdravím,

dovolil som si spraviť veľmi jednoduchý python skrip, ktorý daný súbor opravý. Snáď niekomu pomôže.

Hello,

I made a very simple python script, which can repair the broken file. I hope that it can help someone.

from covid19-data.

sakonn avatar sakonn commented on May 26, 2024

My solution is to convert OpenData_Slovakia_CovidAutomat.xlsx to csv through cloudconvert service. It's free and works perfectly.

# coding=UTF-8

import cloudconvert

api_key = 'XXXXXXX'
sandbox = False

cloudconvert.configure(api_key = api_key,sandbox = sandbox)

result = cloudconvert.Job.create(payload={
     "tasks": {
         'import-covid-data': {
              'operation': 'import/url',
              'url': 'https://github.com/Institut-Zdravotnych-Analyz/covid19-data/raw/main/OpenData_Slovakia_CovidAutomat.xlsx',
              'filename': 'OpenData_Slovakia_CovidAutomat.xlsx'
         },
         'convert-covid-data': {
             'operation': 'convert',
             'input': 'import-covid-data',
             'output_format': 'csv',
             'some_other_option': 'value'
         },
         'export-covid-data': {
             'operation': 'export/url',
             'input': 'convert-covid-data',
             'inline': False,
             'archive_multiple_files': False
         }
     }
 })

exported_url_task_id = result['tasks'][2]['id']
res = cloudconvert.Task.wait(id=exported_url_task_id) # Wait for job completion
file = res.get("result").get("files")[0]
res = cloudconvert.download(filename=file['filename'], url=file['url'])

Result is downloaded file: OpenData_Slovakia_CovidAutomat.csv without any encoding error.

from covid19-data.

achjaj avatar achjaj commented on May 26, 2024

Btw, I also created Java wrapper around automat.gov.sk.

from covid19-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.