Giter VIP home page Giter VIP logo

torsimany's People

Contributors

cfgmr avatar polbaladas avatar sufuf3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

torsimany's Issues

encoding/decoding errors in loadJSON()

I installed the program with pip install torsimany.

Then I downloaded the example files, but I get two kinds of error when trying to convert them to markdown:

Error type 1: AttributeError: 'str' object has no attribute 'decode'

This happens with files products.json, Traffic_Incidents_microsoft.json or any other json file of my own ... except loklak.json (see error 2).

command:
c:\>C:\Users\Abu\AppData\Local\Programs\Python\Python38\scripts\torsimany c:\temp\products.json

output:

Traceback (most recent call last):
  File "c:\users\abu\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\abu\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\abu\AppData\Local\Programs\Python\Python38\scripts\torsimany.exe\__main__.py", line 7, in <module>
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 73, in main
    justdoit(input_file, output_file)
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 60, in justdoit
    json_data = loadJSON(input_file)
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 11, in loadJSON
    data = f.read().decode('ascii', 'ignore')
AttributeError: 'str' object has no attribute 'decode'

Looking to that line 11
data = f.read().decode('ascii', 'ignore')
... as I am using Python 3.8, I think the might be related to this

Error type 2: UnicodeDecodeError: 'charmap' codec can't decode byte

This error only happens when trying to convert the loklak.json file (also mentioned in #9):
https://raw.githubusercontent.com/PolBaladas/torsimany/master/Examples/loklak.json

command:
c:\>C:\Users\Abu\AppData\Local\Programs\Python\Python38\scripts\torsimany c:\temp\loklak.json

output:

Traceback (most recent call last):
  File "c:\users\abu\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\abu\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\abu\AppData\Local\Programs\Python\Python38\scripts\torsimany.exe\__main__.py", line 7, in <module>
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 73, in main
    justdoit(input_file, output_file)
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 60, in justdoit
    json_data = loadJSON(input_file)
  File "c:\users\abu\appdata\local\programs\python\python38\lib\site-packages\torsimany\torsimany.py", line 11, in loadJSON
    data = f.read().decode('ascii', 'ignore')
  File "c:\users\abu\appdata\local\programs\python\python38\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 7446: character maps to <undefined>

My system:
Windows 7
Python 3.8

non ascii characters are deleted during conversion

I have been looking at the provided examples and I think torsimany is not properly converting some encodings.

See this line:
https://github.com/PolBaladas/torsimany/blob/master/Examples/loklak.json#L217
"text": "Инвестиционная идея: XEROX: http://youtu.be/_lD1AuNzSJY?a на @YouTube",

I can't find those cyrillic characters in the converted markdown example. They are replaced by nothing:
https://github.com/PolBaladas/torsimany/blob/master/Examples/loklak.markdown?plain=1#L202
* text: : XEROX: http://youtu.be/_lD1AuNzSJY?a @YouTube

Thanks
@abubelinha

URL as input

URL as string input.
Read URL's content's and work from the JSON data obtained.

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.