Initial import
Change-Id: I91c66e3ceb8d17e547f2e96bf273beb7a4b76762
diff --git a/examples/hello_world.py b/examples/hello_world.py
new file mode 100755
index 0000000..1309f3b
--- /dev/null
+++ b/examples/hello_world.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+import rpy2.robjects.packages as packages
+import rpy2.robjects.pandas2ri as pandas2ri
+import plotly.express as px
+pandas2ri.activate()
+
+QUERY = "Hello World"
+YEARS = range(2010, 2019)
+COUNTRIES = ["DE", "CH"]
+
+RKorAPClient = packages.importr('RKorAPClient')
+kcon = RKorAPClient.KorAPConnection(verbose=True)
+
+vcs = ["textType=/Zeit.*/ & pubPlaceKey=" + c + " & pubDate in " + str(y) for c in COUNTRIES for y in YEARS]
+df = RKorAPClient.ipm(RKorAPClient.frequencyQuery(kcon, QUERY, vcs))
+df['Year'] = [y for c in COUNTRIES for y in YEARS]
+df['Country'] = [c for c in COUNTRIES for y in YEARS]
+
+fig = px.line(df, title=QUERY, x="Year", y="ipm", color="Country",
+ error_y="conf.high", error_y_minus="conf.low")
+fig.show()