Python

Frameworks

for the Web, ML & Testing

Arvind Padmanabhan

Web Frameworks

  • Bottle
  • CherryPy
  • Django
  • Falcon
  • Flask
  • Pylons
  • Pyramid
  • Tornado
  • TurboGears
  • web.py
  • web2py

Characteristics

Python 3 support & PEP8 compliant

Can interface with a WSGI app server

MVC or equivalent pattern

ORM (Object Relational Mapping)

Flexible URL routing & templating

Authentication & access control

Security framework

Form validation

AJAX support

Caching support

Internationalization

Session management

Admin panel & CRUD

Testing framework

Good documentation

Ease of deployment

Can be customized & extended

Open license

Active community and updates

"Batteries included"

"Out-of-the-box-approach"

"Full-stack"

"Bare bones"

"Add-as-you-use-approach"

"Non-full-stack"

Flask

Bottle

CherryPy

Django

web2py

Pyramid

TurboGears

PEP8 & Complexity

Performance

WSGI Servers

  1. Green Unicorn
  2. uWSGI
  3. Apache mod_wsgi
  4. CherryPy
  5. Google App Engine
  6. Azure App Service
  7. Any PaaS ...

Some WSGI Servers:

http://wsgi.readthedocs.io/en/latest/servers.html

https://www.fullstackpython.com/platform-as-a-service.html

DB API

  1. PEP 249
  2. Portable code
  3. Flexibility to use any DB
  4. Easily understood code

Article Pages For Devopedia

  • Python web frameworks
  • Python template engines
  • Python ORM
  • WSGI
  • Django
  • Flask
  • Pyramid

For Further Study

1. https://jeffknupp.com/blog/2014/03/03/what-is-a-web-framework/

2. https://www.fullstackpython.com/web-frameworks.html

3. https://wiki.python.org/moin/WebFrameworks

4. http://klen.github.io/py-frameworks-bench/

5. https://www.linkedin.com/pulse/best-10-python-frameworks-web-development-elyn-z-6059523132912394240

6. http://steelkiwi.com/blog/best-python-web-frameworks-to-learn/

7. http://insights.dice.com/2016/11/22/5-top-python-web-frameworks-2017/

8. https://www.airpair.com/python/posts/django-flask-pyramid

9. https://djangodeployment.com/2017/01/02/which-wsgi-server-should-i-use/

10. http://codecondo.com/14-minimal-web-frameworks-for-python/

11. http://www.bestwebframeworks.com/compare-web-frameworks/python/

12. https://en.wikipedia.org/wiki/Comparison_of_web_frameworks#Python_2

13. https://www.fullstackpython.com/template-engines.html

DL/ML Frameworks

Deep Learning

Apache Singa, Brainstorm, Caffe, Chainer, CNTK, Keras, Lasagne, mxnet, Neon, Paddle, PyTorch, TensorFlow, Theano, Veles

General

Amazon Machine Learning, Apache MLlib, Apache SystemML, Azure ML Studio, DMTK, Google Cloud Machine Learning, NumPy, Pandas, Pattern, Scikit-learn

No Silver Bullet

Source: https://www.slideshare.net/AIFrontiers/yangqing-jia-towards-better-dl-frameworks

Characteristics

Multi-GPU & Multi-node support

OpenMP & OpenCL support

CUDA support

Modelling capability: CNN, RNN, RBM ...

Interfaces well

 

Licensing

Modular & extensible

Good documentation

Community support

Active maintenance

Performance

Language bindings

Top ML Frameworks

Performance

Performance

Article Pages For Devopedia

  • Python ML frameworks
  • TensorFlow
  • Theano
  • Cloud ML
  • SWIG

For Further Study

1. https://deeplearning4j.org/compare-dl4j-torch7-pylearn

2. https://en.wikipedia.org/wiki/Comparison_of_deep_learning_software

3. https://elitedatascience.com/python-deep-learning-libraries

4. http://www.pyimagesearch.com/2016/06/27/my-top-9-favorite-python-deep-learning-libraries/

5. http://www.infoworld.com/article/3026262/data-science/13-frameworks-for-mastering-machine-learning.html

6. http://www.kdnuggets.com/2017/02/python-deep-learning-frameworks-overview.html

7. http://www.kdnuggets.com/2016/04/top-15-frameworks-machine-learning-experts.html

Testing

Frameworks

doctest, Hypothesis, nose, pytest, testtools, unittest, unittest.mock, zope.testing

RedwoodHQ, Robot Framework, Katalon Studio, Selenium, TestComplete, UFT

RedwoodHQ, Robot Framework, UFT

pytest-cov, python-coveralls, coverage

Unit Testing

Web Testing

Coverage

Acceptance

Testing

Approaches to Testing

Module Based

Library Based

Data Driven

Keyword Driven

Behaviour Driven

Hybrid

Characteristics

Python 3 support & PEP8 compliant

Mock fixtures

Reporting summary, details, duration, logs

Descriptive reporting for failures

Test discovery

Skip tests or conditional execution

Dependency & order of execution

Web/mobile apps: record & replay

Testing approach

 

 

Setup and teardown at various levels

Tests are reusable, maintainable, stable

Parameterized/fuzzy testing

Parallel execution

Includes or integrates with coverage tools

Easy to debug

Good documentation

Can be customized & extended

Open license

Active community and updates

Article Pages For Devopedia

  • Python-based test frameworks
  • Testing approaches
  • Selenium
  • Robot Framework
  • Katalon Studio

For Further Study

1. https://wiki.python.org/moin/PythonTestingToolsTaxonomy

2. https://www.toptal.com/python/an-introduction-to-mocking-in-python

3. http://tjelvarolsson.com/blog/four-tools-for-testing-your-python-code/

4. https://www.slant.co/topics/2621/~python-unit-testing-frameworks

5. https://techbeacon.com/6-top-open-source-testing-automation-frameworks-how-choose

6. https://www.ibm.com/developerworks/aix/library/au-python_test/

7. https://www.katalon.com/resources-center/blog/comparison-automated-testing-tools/

8. http://www.guru99.com/quick-test-professional-qtp-tutorial-34.html

9. http://www.softwaretestinghelp.com/test-automation-frameworks-selenium-tutorial-20/

Python Frameworks

By Arvind Padmanabhan

Python Frameworks

Frameworks in Python for making web apps, for Machine Learning, or automated testing.

  • 1,036