mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-27 10:19:59 +00:00
0c667b13ae
* CSV * PDF (requires Python dependency `weasyprint`) * ODS (requires Python dependency `pyexcel_ods3`) Signed-off-by: Thomas Citharel <tcit@tcit.fr>
12 lines
300 B
Python
12 lines
300 B
Python
from pyexcel_ods3 import save_data
|
|
from collections import OrderedDict
|
|
from io import BytesIO as StringIO
|
|
import json
|
|
|
|
def generate(data):
|
|
struct = json.loads(data)
|
|
data = OrderedDict()
|
|
data.update({"Sheet 1": struct})
|
|
io = StringIO()
|
|
save_data(io, data)
|
|
return io.getvalue()
|