polbaladas / torsimany Goto Github PK
View Code? Open in Web Editor NEW💡✏️️ ⬇️️ JSON to Markdown converter - Generate Markdown from format independent JSON
License: MIT License
💡✏️️ ⬇️️ JSON to Markdown converter - Generate Markdown from format independent JSON
License: MIT License
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:
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
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
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 string input.
Read URL's content's and work from the JSON data obtained.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.