File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 77import json
88import re
99import requests
10+ from xmljson import badgerfish as bf
11+ from json import dumps
1012
1113
1214class Loklak (object ):
@@ -54,6 +56,17 @@ def status(self):
5456 return_to_user = {}
5557 return json .dumps (return_to_user )
5658
59+ def xmlToJson (self , xmlData = None ):
60+ """Converts XML to JSON as the service"""
61+ jsonData = ''
62+ if xmlData :
63+ jsonData = dumps (bf .data (fromstring (xmlData )))
64+ return jsonData
65+
66+ def csvToJson (self ):
67+ """Converts CSV to JSON as the service"""
68+
69+
5770 def hello (self ):
5871 """Gives a hello"""
5972 hello_application = 'api/hello.json'
Original file line number Diff line number Diff line change 11asyncoro == 3.5
22requests == 2.8.1
33wsgiref == 0.1.2
4+ xmljson == 0.1.6
5+
You can’t perform that action at this time.
0 commit comments