diff --git a/etc/TODO.md b/etc/TODO.md index 74e7c4fc6a475382ead0547e7167ee3b6c5de91c..2af000d82e4072452faa8a1469be752489345d96 100644 --- a/etc/TODO.md +++ b/etc/TODO.md @@ -46,4 +46,13 @@ * Fixed #41 SQLalchemy instead of SQL: EcdcImport.get_countries_of_continent() * Fixed #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent * Fixed #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep -* Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent \ No newline at end of file +* Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent + +### Research +* add Flask-Caching https://pypi.org/project/Flask-Caching/ +* add Flask-Monitoring https://pypi.org/project/Flask-Monitoring/ +* add Flask-Redisboard https://pypi.org/project/Flask-Redisboard/ +* add Flask-Babel https://pypi.org/project/Flask-Babel/ +* add flask-resources https://pypi.org/project/flask-resources/ +* add flask-whooshalchemy3 https://pypi.org/project/flask-whooshalchemy3/ https://github.com/blakev/Flask-WhooshAlchemy3 +* add flask-filealchemy https://pypi.org/project/flask-filealchemy/ diff --git a/requirements/build.in b/requirements/build.in index d0bb3a33519e27450757e17d18871e2f1ce1de7b..55fcc8b3af0765167d9a7dadeb87c65859f8a94c 100644 --- a/requirements/build.in +++ b/requirements/build.in @@ -10,4 +10,6 @@ pytoml==0.1.21 venv-run==0.1.0 six==1.13.0 pbr==3.1.1 -pre-commit==2.10.1 \ No newline at end of file +pre-commit==2.10.1 +chardet==3.0.4 +python-dotenv>=0.15.0 diff --git a/requirements/build.txt b/requirements/build.txt index cbd0a7a2d2b84f0f41d8ce4f2d09461208027c04..5c389499e997f933c6a044d93e40d724abeaa9c1 100644 --- a/requirements/build.txt +++ b/requirements/build.txt @@ -14,8 +14,10 @@ certifi==2020.12.5 # requests cfgv==3.2.0 # via pre-commit -chardet==4.0.0 - # via requests +chardet==3.0.4 + # via + # -r requirements\build.in + # requests click==7.1.2 # via pip-tools distlib==0.3.1 diff --git a/requirements/dev.in b/requirements/dev.in index b00b6da498618b2483a8c2553915d8b32aba384e..f086f1a9c3fc77561c4f6d3af3872315cb6920de 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -5,27 +5,17 @@ Flask>=1.1.2 Flask-SQLAlchemy>=2.4.4 Flask-Cors>=3.0.10 Flask-BS4>=4.5.3.0,<5.0.0.0 -flask-resources==0.6.0 -Flask-ResponseBuilder>=2.0.12 Flask-Babel>=2 Flask-Admin>=1.5.7 Flask-Redisboard>=0.2.0 -Flask-Monitoring>=1.1.2 -flask-healthz>=0.0.2 -Flask-Caching>=1.9.0 -Flask-DB>=0.3.0 -Flask-Moment>=0.11.0 flask-whooshalchemy3>=0.2.0 Flask-PluginKit>=3.6.0 -flask-filealchemy>=0.6.1 SQLAlchemy>=1.3.23 celery[redis]>=5.0.5 psycopg2>=2.8.6 wget>=3.2 -aiocronjob>=0.2.0 pyecharts>=1.9.0 pyecharts-extras>=0.0.5 -reactive-pyecharts>=1.0.0 visdom>=0.1.8.9 pynndescent>=0.5.1 torch>=1.7.1 @@ -33,8 +23,3 @@ numpy>=1.20.1 pandas>=1.1.0 scipy>=1.5.0 StatisticalDiagrams>=20.5 -#chardet==3.0.4 -chardet==4.0.0 -pytz==2021.1 -ruamel.yaml==0.1.6.12 -identify==1.5.14 diff --git a/requirements/dev.txt b/requirements/dev.txt index 1f0bbb1a9a141e88e6e7f367677bf0c964e5bed2..57aae828197925d85bb652c6fd64f553d22fc8f3 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -45,7 +45,7 @@ cfgv==3.2.0 # via pre-commit chardet==3.0.4 # via - # -r requirements\dev.in + # -r requirements\build.in # requests cleo==0.8.1 # via plantuml2freemind @@ -380,7 +380,6 @@ pytoolbox==14.0.0 # via -r requirements\build.in pytz==2020.5 # via - # -r requirements\dev.in # aiocronjob # apscheduler # babel diff --git a/requirements/docs.in b/requirements/docs.in index 4408c0c12a977e1472294ea38be252fca0c71266..c12d2abd0ce08c33b374d83c4109412b339c616e 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -1,16 +1,12 @@ sphinx>=3.4.3,<3.5.0 -sphinx-tabs==2.0.1 -sphinx-issues==1.2.0 sphinxcontrib-plantuml==0.19 sphinxcontrib-gravizo==0.0.4 sphinxcontrib-log-cabinet==1.0.1 -pallets-sphinx-themes==1.2.3 py2puml>=0.3.1 plantuml-creator==1.0.7 plantuml-markdown==3.4.2 plantuml-wrapper==0.1.0 plantuml2freemind==0.8.2 plantuml-gentools==0.1.2 -manual-sitemap>=19.6.0 speaklater==1.3 tokenize-rt>=4.1.0 diff --git a/requirements/tests.in b/requirements/tests.in index 06e2eddcb8f65b02d480fcf30073151314a6fe9d..0c0b838748945765a68aee9e07d97b605ac9aa9c 100644 --- a/requirements/tests.in +++ b/requirements/tests.in @@ -1,4 +1,3 @@ -python-dotenv>=0.15.0 pytest>=5.3.2,<6.0.0 pytest-venv>=0.2.1 pytest-runner>=5.3.0 @@ -6,5 +5,5 @@ pytest-postgresql>=2.6.1 pytest-flask>=1.1.0 pytest-flask-sqlalchemy>=1.0.2 pytest-enabler>=1.2.0 -flask-unittest>=0.1.1 Flask-Fixtures>=0.3.8 +Flask-DB>=0.3.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 840b13c3c8a28a3e6b8fdb16e14cc5affbc7e013..c34ecbb847ed5f160c701be9ae16751898d1bbb3 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ requires_build = [ "argparse==1.4.0", "certifi==2020.12.5", "cfgv==3.2.0", - "chardet==4.0.0", + "chardet==3.0.4", "click==7.1.2", "distlib==0.3.1", "filelock==3.0.12", @@ -132,7 +132,6 @@ requires_docs = [ "markupsafe==1.1.1", "more-itertools==8.0.2", "packaging==20.0", - "pallets-sphinx-themes==1.2.3", "pastel==0.2.1", "pbr==5.5.1", "plantuml-creator==1.0.7", @@ -323,8 +322,6 @@ requires_dev = [ "reactive-pyecharts==1.0.0", "redis==3.5.3", "requests==2.25.1", - "ruamel-yaml==0.16.12", - "ruamel.yaml.clib==0.2.2", "scikit-learn==0.24.1", "scipy==1.6.0", "semver==2.13.0", @@ -390,7 +387,7 @@ packages = find_packages() setup( name='covid19python', version=version, - url='ttps://github.com/thomaswoehlke/covid19python.git', + url='https://github.com/thomaswoehlke/covid19python.git', license='GNU General Public License v3 (GPLv3)', author='Thomas Woehlke', author_email='thomas.woehlke@gmail.com', diff --git a/src/database.py b/src/database.py index 749581556614b0c3dcd9de9e5107d9754e4c6c5c..70c2f07a668a4bdda0017119448781b1a57eadb6 100644 --- a/src/database.py +++ b/src/database.py @@ -1,6 +1,8 @@ import logging from flask import Flask, logging import flask_monitoringdashboard as dashboard +from flask_caching import Cache +from flask_pluginkit import PluginManager from flask_redisboard import RedisBoardExtension from flask_cors import CORS from flask_bs4 import Bootstrap @@ -11,6 +13,8 @@ from celery import Celery from celery.utils.log import LoggingProxy board = RedisBoardExtension() +pm = PluginManager() +cache = Cache(config={"CACHE_TYPE": "simple"}) def create_app(): my_app = Flask('covid19') @@ -25,8 +29,10 @@ def create_app(): my_app.config['SQLALCHEMY_DATABASE_URI'] = db_url my_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # silence the deprecation warning my_app.config['FLASK_ADMIN_SWATCH'] = 'superhero' - #dashboard.bind(my_app) + pm.init_app(app) board.init_app(my_app) + cache.init_app(app) + #dashboard.bind(my_app) return my_app