Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made simple flask app

  • Loading branch information...
commit cd797b5e0d2b6d112a66b4bf244ed68c770d38c9 1 parent 979dc64
@rjurney authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 index.py
View
12 index.py
@@ -1,3 +1,15 @@
from flask import Flask
import pycassa
+import json
+pool = pycassa.ConnectionPool('enron')
+cf = pycassa.ColumnFamily(pool, 'email_topics')
+
+app = Flask(__name__)
+
+@app.route("/message/topics/<message_id>")
+def topics(message_id):
+ return json.dumps(cf.get(message_id))
+
+if __name__ == "__main__":
+ app.run(debug=True)
Please sign in to comment.
Something went wrong with that request. Please try again.