Ein Open Source Kochrezept
Ottmar Gobrecht
DOAG Konferenz 2016, Nürnberg
Appetithäppchen
Einwohnerentwicklung New York, Rio, Tokio
1940 - 2010
Population Development,New York,Rio,Tokio
1940,7454995,1759277,6778804
1950,7891957,2375280,5385071
1960,7781984,3300431,8310027
1970,7895563,4251918,8840942
1980,7071639,5090723,8351893
1990,7322564,5480768,8163573
2000,8008278,5857904,8134688
2010,8175133,6320446,8980768
Selber Kochen
# Eine Überschrift
Ein kurzer Absatz.
* Ein Aufzählungspunkt
* Noch einer mit *kursivem* und **fettem** Text
HTML = Publikations-Format
Markdown = Schreib-Format
Komplette ursprüngliche Syntax, Weiterentwicklungen, das APEX Plugin
pandoc demo.md --from=markdown --to=html --output=demo.html
Muss dazu noch etwas gesagt werden?
pip3 install -U pip
python -m pip install -U pip
pip3 install matplotlib
pip3 install pandas
pip3 install seaborn
pip3 install jupyter
npm install
(dort, wo package.json liegt)node app.js
oracle_plsql
SELECT markdown_reporter.convert_document(
p_format => 'pdf' -- html, pdf, docx (with png's only)
, p_markdown => markdown_reporter.preprocess_data(p_markdown => q'[
``` { .sql .chart .line caption="Demo Chart"}
SELECT 1940 "Population Development", 7454995 "New York", 1759277 "Rio"
, 6778804 "Tokio" FROM dual UNION ALL
SELECT 1950,7891957,2375280,5385071 FROM dual UNION ALL
SELECT 1960,7781984,3300431,8310027 FROM dual UNION ALL
SELECT 1970,7895563,4251918,8840942 FROM dual UNION ALL
SELECT 1980,7071639,5090723,8351893 FROM dual UNION ALL
SELECT 1990,7322564,5480768,8163573 FROM dual UNION ALL
SELECT 2000,8008278,5857904,8134688 FROM dual UNION ALL
SELECT 2010,8175133,6320446,8980768 FROM dual;
```
]'))
FROM dual;
SELECT markdown_reporter.preprocess_data(p_markdown => '...')
FROM dual;
``` { .sql .chart .line caption="Demo Chart"}
"Population Development","New York","Rio","Tokio"
"1940","7454995","1759277","6778804"
"1950","7891957","2375280","5385071"
"1960","7781984","3300431","8310027"
"1970","7895563","4251918","8840942"
"1980","7071639","5090723","8351893"
"1990","7322564","5480768","8163573"
"2000","8008278","5857904","8134688"
"2010","8175133","6320446","8980768"
```
Die ganze Magie findet in einem Pandoc Filter statt
# read csv data from code block
df = pd.read_csv(StringIO( code ), index_col=0, parse_dates=True)
# create chart
if charttype == 'line':
ax = df.plot.line(subplots=False, figsize=(width/96, height/96), \
legend=legend) # size must be given in inches, default is 96 dpi
#---<snip>-----------------------------------------------------------
# set title and axis labels
if title != '':
ax.set_title(title)
#---<snip>-----------------------------------------------------------
# clean up chart with seaborn despine method
sns.despine()
# save chart
plt.savefig(filename)
Jupyter Start mit Shellaufruf:
jupyter notebook
Jupyter-Docs, Das Notizbuch aus dem Markdown Reporter Projekt
Notebook Schritt für Schritt ausführen
Für einen unverbindlichen Test oder eine temporäre Entwicklungsumgebung ohne Adminrechte:
msiexec /a pathToMsiFile /qb TARGETDIR=pathToTargetDir