Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clean Architecture - PythonRio

Andre Fonseca
December 10, 2016

Clean Architecture - PythonRio

Presentation about clean architecture and python at last meetup of PythonRio.

Andre Fonseca

December 10, 2016
Tweet

More Decks by Andre Fonseca

Other Decks in Technology

Transcript

  1. REACT / ANGULAR JS WEBSOCKET JSON NGINX CIRCUS TORNADO /

    FLASK / DJANGO MYSQL / MONGO / POSTGRES
  2. • Uncoupled • Allow to delay choices and decisions about

    using some techies (ex: database, libs, etc) • Easy to evolve (add features, change behaves) • Solution and propose at first view • Domain more important than libs / frameworks
  3. # -*- coding: utf-8 -*- import requests def main(word): url

    = “http://api.duckduckgo.com/?q={}&format=json&pretty=1” url = url.format(word) response = requests.get(url) # io results = response.json()[‘Results’] # io print results
  4. def build_url(word): url = “http://api.duckduckgo.com/?q={}&format=json” return url.format(word) def find(url): response

    = requests.get(url) return response def process_result(response): json = response.json() return json.get(’Results’, []) def main(word): url = build_url(word) response = find(url) print process_result(response)