SlideShare a Scribd company logo
A Python a web service

A Python a web service
@vtemian
A Python a web service

Let’s imagine
a perfect world...
A Python a web service

WEB APPLICATION
A Python a web service

Tools & Utilities

WEB APPLICATION
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

management tools
supporting services

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

management tools

user interface

supporting services

api service
data persistence
auth
crud admin

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

Single codebase are
EVIL!
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

SS
E
M
AL
T
TO
data persistence
auth
crud admin
A Python a web service

Decouple!
A Python a web service

Developers

End Users

API service
Data persistence

Frontend
A Python a web service

Developers

API service

End Users

API service

Internal

API service

Data persistence
A Python a web service

Good API
A Python a web service

Good API
A Python a web service

Good API
Intuitive

similar things should be similar,
ugly things should look ugly

Documented
Opinionated
A Python a web service

Features

posting of data
with validation

pagination

propper HTTP
response handling
permissions

throttling
serialization

authentification
A Python a web service

Django

regex routing system
A Python a web service

Django

regex routing system

built-in orm
A Python a web service

Django

users = Users.objects.filter(last_login__lt=timestamp)
A Python a web service

Django

regex routing system

built-in orm

templating system
auth
management tools

crud admin
migrations
testing tools

makes decision for you
A Python a web service

NOBODY CARES
A Python a web service

Developers

API service

Django
End Users

API service

Internal

API service

Data persistence
A Python a web service

Django

regex routing system

testing tools

templating system
makes decision for you
A Python a web service
A Python a web service

Django REST Framework
A Python a web service

Just install it, write 20 lines of code
> CRUD API
A Python a web service

API Console
A Python a web service

Great community
A Python a web service

Easy to document your API
A Python a web service

Integration test using
APIRequestFactory
A Python a web service

OAuth 1 & 2 out of the box
A Python a web service

Serialization
A Python a web service

Django paginator
or PaginationSerializer
A Python a web service

Object or field level validation
A Python a web service

Using django caching policy
A Python a web service

For throttling, just add:
DEFAULT_THROTTLE_CLASSES +
DEFAULT_THROTTLE_RATES
in settings.py
A Python a web service

Powerful and extensible
object level permissions
A Python a web service
A Python a web service

Depends on Django >
get all the Django mess
A Python a web service

Pretty huge
A Python a web service

Can do a lot of black magic
A Python a web service

Rigid
A Python a web service

Django Tastypie
A Python a web service

Plug and play
A Python a web service

Decent auth support
A Python a web service

Documented
A Python a web service

Still supported
A Python a web service

Paginator for pagination
A Python a web service

Validation --- you can extend it
A Python a web service

serializer = Serializer(formats=[‘json’, ‘jsonp’, ‘xml’,
‘yaml’, ‘html’, ‘plist’])
A Python a web service

throttle = BaseThrottle(throttle_at=100)
A Python a web service

NO NO NO
A Python a web service

Not intuitive
A Python a web service

Ugly
A Python a web service
class ParentResource(ModelResource):
children = fields.ToManyField(ChildResource, ‘children’)
def prepend_urls(self):
return [
url(r”^(?P<resource_name>%s)/(?P<pk>w[w/-]*)/children%s$” % (self._meta.resource_name, trailing_
slash()), self.wrap_view(‘get_children’), name=”api_get_children”),
]
def get_children(self, request, **kwargs):
try:
bundle = self.build_bundle(data={‘pk’: kwargs[‘pk’]}, request=request)
obj = self.cached_obj_get(bundle=bundle, **self.remove_api_resource_names(kwargs))
except ObjectDoesNotExist:
return HttpGone()
except MultipleObjectsReturned:
return HttpMultipleChoices(“More than one resource is found at this URI.”)
child_resource = ChildResource()
return child_resource.get_detail(request, parent_id=obj.pk)
A Python a web service

Depends on Django >
get all the Django mess
A Python a web service

Can do lot black magic
Can do aalot of black magic
A Python a web service

Rigid
A Python a web service

Flask
A Python a web service
A Python a web service

from flask import Flask
app = Flask(__name__)
@app.route(“/”)
def hello():
return “Hello World!”
if __name__ == “__main__”:
app.run()
A Python a web service

Werkzeug, Jinja 2 and good intentions
A Python a web service

Very small and easy to learn
(super intuitive)
A Python a web service

Solid and well documented
A Python a web service

Awesome and strong community
A Python a web service

Great debugging tools
A Python a web service

Application dispatcher (on wsgi level)
A Python a web service

Integrating unittest and integration tests
(also check flask-testing)
A Python a web service

Signals
A Python a web service

Configuration == dict
A Python a web service

Blueprints
A Python a web service

Response object == wsgi app
A Python a web service

SHOW ME THE SOURCE
YOU MUST
A Python a web service

BYOB
A Python a web service

Some batteries
Flask-SQLAlchemy

Flask-Testing
Flask-Oauthlib

Flask-Classy
Flask-Cache

Flask-Script
Flask-Principal
A Python a web service
A Python a web service

Q/A
A Python a web service

Resources
Kenneth Reitz
Flask Goodness
API Driven Development
How I develop Things and Why?
Kevin Lacker
How to Design Great APIs?
A Python a web service

Thank you!

DRINK ALL THE BEERS!

More Related Content

What's hot

Http protocol
Http protocolHttp protocol
Http protocol
Arpita Naik
 
Packages in java
Packages in javaPackages in java
Packages in java
Elizabeth alexander
 
Variables in python
Variables in pythonVariables in python
Variables in python
Jaya Kumari
 
Servlets
ServletsServlets
Python Collections Tutorial | Edureka
Python Collections Tutorial | EdurekaPython Collections Tutorial | Edureka
Python Collections Tutorial | Edureka
Edureka!
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Method overriding
Method overridingMethod overriding
Method overriding
Azaz Maverick
 
Python ppt
Python pptPython ppt
Python ppt
Rachit Bhargava
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
Sharath Ankrajegowda
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
Mayank Bhatt
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
moazamali28
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
Files in php
Files in phpFiles in php
Files in php
sana mateen
 
Python GUI
Python GUIPython GUI
Python GUI
LusciousLarryDas
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
 
Php array
Php arrayPhp array
Php array
Nikul Shah
 

What's hot (20)

Http protocol
Http protocolHttp protocol
Http protocol
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Variables in python
Variables in pythonVariables in python
Variables in python
 
Servlets
ServletsServlets
Servlets
 
Python Collections Tutorial | Edureka
Python Collections Tutorial | EdurekaPython Collections Tutorial | Edureka
Python Collections Tutorial | Edureka
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Method overriding
Method overridingMethod overriding
Method overriding
 
Python ppt
Python pptPython ppt
Python ppt
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Files in php
Files in phpFiles in php
Files in php
 
Python GUI
Python GUIPython GUI
Python GUI
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Php array
Php arrayPhp array
Php array
 

Viewers also liked

Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
Mykhailo Kolesnyk
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
Panoptic Development, Inc.
 
Django by mrjmad
Django by mrjmadDjango by mrjmad
Django by mrjmad
Jean-Michel ARMAND
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
Christopher Foresman
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
Marcel Chastain
 
Python et les bases de données non sql
Python et les bases de données non sqlPython et les bases de données non sql
Python et les bases de données non sql
bchesneau
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
Solution4Future
 
Building Automated REST APIs with Python
Building Automated REST APIs with PythonBuilding Automated REST APIs with Python
Building Automated REST APIs with Python
Jeff Knupp
 
Python et son intégration avec Odoo
Python et son intégration avec OdooPython et son intégration avec Odoo
Python et son intégration avec Odoo
Hassan WAHSISS
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
Hannes Hapke
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
Larry Cai
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Bosco Basabana
 
Créer une api publique avec Django REST framework
Créer une api publique avec Django REST frameworkCréer une api publique avec Django REST framework
Créer une api publique avec Django REST framework
Bleemeo
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancépierrepo
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
Nicola Iarocci
 
Apache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéroApache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéro
Alexandre Pereira
 

Viewers also liked (16)

Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Django by mrjmad
Django by mrjmadDjango by mrjmad
Django by mrjmad
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
Python et les bases de données non sql
Python et les bases de données non sqlPython et les bases de données non sql
Python et les bases de données non sql
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Building Automated REST APIs with Python
Building Automated REST APIs with PythonBuilding Automated REST APIs with Python
Building Automated REST APIs with Python
 
Python et son intégration avec Odoo
Python et son intégration avec OdooPython et son intégration avec Odoo
Python et son intégration avec Odoo
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
 
Créer une api publique avec Django REST framework
Créer une api publique avec Django REST frameworkCréer une api publique avec Django REST framework
Créer une api publique avec Django REST framework
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancé
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
 
Apache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéroApache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéro
 

Similar to A python web service

Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
Bastian Hofmann
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
Ruslan Meshenberg
 
Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
Bastian Hofmann
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
Skills Matter
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
Amazon Web Services
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Amazon Web Services
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
Tikal Knowledge
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
guest1af57e
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
Mike Malone
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
Piero Bellomo
 
Gohan
GohanGohan
Gohan
Nachi Ueno
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
Gabriel Lucaciu
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
Wellfire Interactive
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
Jens Ravens
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
Amazon Web Services
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
之宇 趙
 
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Max Lai
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
Haehnchen
 

Similar to A python web service (20)

Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
 
Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
 
Gohan
GohanGohan
Gohan
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 

Recently uploaded

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 

Recently uploaded (20)

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 

A python web service

  • 1. A Python a web service A Python a web service @vtemian
  • 2. A Python a web service Let’s imagine a perfect world...
  • 3. A Python a web service WEB APPLICATION
  • 4. A Python a web service Tools & Utilities WEB APPLICATION
  • 5. A Python a web service WEB APPLICATION Tools & Utilities Web Process
  • 6. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process
  • 7. A Python a web service WEB APPLICATION Tools & Utilities Web Process management tools supporting services Worker Process
  • 8. A Python a web service WEB APPLICATION Tools & Utilities Web Process management tools user interface supporting services api service data persistence auth crud admin Worker Process
  • 9. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 10. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 11. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 12. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 13. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 14. A Python a web service Single codebase are EVIL!
  • 15. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks SS E M AL T TO data persistence auth crud admin
  • 16. A Python a web service Decouple!
  • 17. A Python a web service Developers End Users API service Data persistence Frontend
  • 18. A Python a web service Developers API service End Users API service Internal API service Data persistence
  • 19. A Python a web service Good API
  • 20. A Python a web service Good API
  • 21. A Python a web service Good API Intuitive similar things should be similar, ugly things should look ugly Documented Opinionated
  • 22. A Python a web service Features posting of data with validation pagination propper HTTP response handling permissions throttling serialization authentification
  • 23. A Python a web service Django regex routing system
  • 24. A Python a web service Django regex routing system built-in orm
  • 25. A Python a web service Django users = Users.objects.filter(last_login__lt=timestamp)
  • 26. A Python a web service Django regex routing system built-in orm templating system auth management tools crud admin migrations testing tools makes decision for you
  • 27. A Python a web service NOBODY CARES
  • 28. A Python a web service Developers API service Django End Users API service Internal API service Data persistence
  • 29. A Python a web service Django regex routing system testing tools templating system makes decision for you
  • 30. A Python a web service
  • 31. A Python a web service Django REST Framework
  • 32. A Python a web service Just install it, write 20 lines of code > CRUD API
  • 33. A Python a web service API Console
  • 34. A Python a web service Great community
  • 35. A Python a web service Easy to document your API
  • 36. A Python a web service Integration test using APIRequestFactory
  • 37. A Python a web service OAuth 1 & 2 out of the box
  • 38. A Python a web service Serialization
  • 39. A Python a web service Django paginator or PaginationSerializer
  • 40. A Python a web service Object or field level validation
  • 41. A Python a web service Using django caching policy
  • 42. A Python a web service For throttling, just add: DEFAULT_THROTTLE_CLASSES + DEFAULT_THROTTLE_RATES in settings.py
  • 43. A Python a web service Powerful and extensible object level permissions
  • 44. A Python a web service
  • 45. A Python a web service Depends on Django > get all the Django mess
  • 46. A Python a web service Pretty huge
  • 47. A Python a web service Can do a lot of black magic
  • 48. A Python a web service Rigid
  • 49. A Python a web service Django Tastypie
  • 50. A Python a web service Plug and play
  • 51. A Python a web service Decent auth support
  • 52. A Python a web service Documented
  • 53. A Python a web service Still supported
  • 54. A Python a web service Paginator for pagination
  • 55. A Python a web service Validation --- you can extend it
  • 56. A Python a web service serializer = Serializer(formats=[‘json’, ‘jsonp’, ‘xml’, ‘yaml’, ‘html’, ‘plist’])
  • 57. A Python a web service throttle = BaseThrottle(throttle_at=100)
  • 58. A Python a web service NO NO NO
  • 59. A Python a web service Not intuitive
  • 60. A Python a web service Ugly
  • 61. A Python a web service class ParentResource(ModelResource): children = fields.ToManyField(ChildResource, ‘children’) def prepend_urls(self): return [ url(r”^(?P<resource_name>%s)/(?P<pk>w[w/-]*)/children%s$” % (self._meta.resource_name, trailing_ slash()), self.wrap_view(‘get_children’), name=”api_get_children”), ] def get_children(self, request, **kwargs): try: bundle = self.build_bundle(data={‘pk’: kwargs[‘pk’]}, request=request) obj = self.cached_obj_get(bundle=bundle, **self.remove_api_resource_names(kwargs)) except ObjectDoesNotExist: return HttpGone() except MultipleObjectsReturned: return HttpMultipleChoices(“More than one resource is found at this URI.”) child_resource = ChildResource() return child_resource.get_detail(request, parent_id=obj.pk)
  • 62. A Python a web service Depends on Django > get all the Django mess
  • 63. A Python a web service Can do lot black magic Can do aalot of black magic
  • 64. A Python a web service Rigid
  • 65. A Python a web service Flask
  • 66. A Python a web service
  • 67. A Python a web service from flask import Flask app = Flask(__name__) @app.route(“/”) def hello(): return “Hello World!” if __name__ == “__main__”: app.run()
  • 68. A Python a web service Werkzeug, Jinja 2 and good intentions
  • 69. A Python a web service Very small and easy to learn (super intuitive)
  • 70. A Python a web service Solid and well documented
  • 71. A Python a web service Awesome and strong community
  • 72. A Python a web service Great debugging tools
  • 73. A Python a web service Application dispatcher (on wsgi level)
  • 74. A Python a web service Integrating unittest and integration tests (also check flask-testing)
  • 75. A Python a web service Signals
  • 76. A Python a web service Configuration == dict
  • 77. A Python a web service Blueprints
  • 78. A Python a web service Response object == wsgi app
  • 79. A Python a web service SHOW ME THE SOURCE YOU MUST
  • 80. A Python a web service BYOB
  • 81. A Python a web service Some batteries Flask-SQLAlchemy Flask-Testing Flask-Oauthlib Flask-Classy Flask-Cache Flask-Script Flask-Principal
  • 82. A Python a web service
  • 83. A Python a web service Q/A
  • 84. A Python a web service Resources Kenneth Reitz Flask Goodness API Driven Development How I develop Things and Why? Kevin Lacker How to Design Great APIs?
  • 85. A Python a web service Thank you! DRINK ALL THE BEERS!