项目作者: TheArtOfPour

项目描述 :
Python based API using eve-sqlalchemy for TAP
高级语言: Python
项目地址: git://github.com/TheArtOfPour/taop-api.git
创建时间: 2018-01-08T23:27:31Z
项目社区:https://github.com/TheArtOfPour/taop-api

开源协议:GNU General Public License v3.0

下载


TheArtOfPour-API

Backend API code for https://theartofpour.com

Python3 based API using eve-sqlalchemy and tensorflow

Thank you to everyone who attended my talk at this year’s HomebrewCon.

I’ll be working over the next few days on getting any remaining code/data deployed, as well as setting licenses and documentation.

Cheers!

Installing eve-sqlalchemy: pip install eve-sqlalchemy

Installing tensorflow: pip install tensorflow

Depending on your setup, you may also need the sqlalchemy drivers for your database.

Starting the API: python app.py

  1. [CondaEnv] PS C:\TheArtOfPour\TheArtOfPour-API> python .\app.py
  2. Using TensorFlow backend.
  3. * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Available endpoints

  • GET /styles
  • GET /yeast
  • GET /hops
  • GET /fermentables
  • POST /test
    • REQUEST:
      1. {
      2. "yeast":"1",
      3. "fermentables":[
      4. {"id":"1","amount":"8"},
      5. {"id":"2","amount":"1"},
      6. {"id":"4","amount":"1"},
      7. {"id":"0","amount":"0"},
      8. {"id":"0","amount":"0"}
      9. ],
      10. "hops":[
      11. {"id":"3","amount":"0.75","time":"60"},
      12. {"id":"3","amount":"0.5","time":"30"},
      13. {"id":"3","amount":"0.5","time":"5"},
      14. {"id":"3","amount":"0.5","time":"0"},
      15. {"id":"0","amount":"0","time":"0"},
      16. {"id":"0","amount":"0","time":"0"},
      17. {"id":"0","amount":"0","time":"0"},
      18. {"id":"0","amount":"0","time":"0"},
      19. {"id":"0","amount":"0","time":"0"}
      20. ]
      21. }
    • RESPONSE:
      1. [
      2. {
      3. "style": "stout",
      4. "confidence": 61.5
      5. },
      6. {
      7. "style": "blonde ale",
      8. "confidence": 0.9
      9. },
      10. {
      11. "style": "american pale ale",
      12. "confidence": 2.4
      13. },
      14. {
      15. "style": "porter",
      16. "confidence": 4.8
      17. },
      18. {
      19. "style": "wheat beer",
      20. "confidence": 0.2
      21. },
      22. {
      23. "style": "imperial ipa",
      24. "confidence": 4.1
      25. },
      26. {
      27. "style": "american ipa",
      28. "confidence": 4.1
      29. },
      30. {
      31. "style": "brown ale",
      32. "confidence": 4.1
      33. },
      34. {
      35. "style": "saison",
      36. "confidence": 0.1
      37. },
      38. {
      39. "style": "kölsch/cream ale",
      40. "confidence": 0.2
      41. },
      42. {
      43. "style": "pilsner/bock",
      44. "confidence": 0.1
      45. },
      46. {
      47. "style": "american amber ale",
      48. "confidence": 3
      49. },
      50. {
      51. "style": "bitter",
      52. "confidence": 1.1
      53. },
      54. {
      55. "style": "specialty beer",
      56. "confidence": 13.3
      57. }
      58. ]

In progress

  • GET /stats : querydsl based, freeform filter endpoint

@todo

  • Make ingredient dimensions dynamic (crop to model inputs or allow ui to request)