SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
How We Use Bottle and
    Elasticsearch
  An Adventure in Sinar Project
A background of Malaysian Bill
Watcher
● The big idea, is to let citizen knows what is
  happening in parliament, bills being debated
  and pass
● No it doesn't know the bills that is not
  debated yet.
● Its is scraper based, just because the
  parliament site tend to be stand alone, and
  nobody bother to go there.
● And cheat on twitter notification
The result
● Didn't quite worked out.
● That is not the point of this talk
● You can talk to us later on this
What we use?
● We use bottle micro framework.
● Elasticsearch via pyes
● sqlalchemy for db abstraction(seriously
  thinking to move to mongodb instead, idea?)
● We use bootstrap for css and their js plugin
● with jquery
● Beaufifulsoup for scraping(that is our data
  source)

We only going to cover pyes and bottle
(talk to me later for everything else)
Bottle
●   A micro framework
●   Similar to flask!!!
●   Less feature though
●   But it is OKAY.
Bottle a views
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/pages.py
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/pages.py
What happen?
● Bottle can return a dict, and it automatically
  output json, if the object in dict is compatible
● Or with View Decorator, the dict can be feed
  to a template
bottle the template
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/views/list.tpl
●
What happen?
● Bottle read template from a dict/object
● like most templating language does.
● Have some logic like other, different syntax
  same idea
● Don't have good inheritance though
elasticsearch!!!
● OK I lied, this is written in JAVA
● But hey, it got RESTful API
● and pyes did a lot of the stuff for us already
Before index
● before we do that
● we don't need to create a schema
● But we do it because we can control the
  search priority
Indexer
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/indexer.py
then we index
● First flatten your result
● convert to dict
● index
The indexer
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/indexer.py
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/loader.py
now we search!!!!
● There is some field inside the search result
● https://github.com/Sinar/Malaysian-Bill-
  Watcher/blob/master/billwatcher/pages.py
The future
●   Do localization
●   Find new data source
●   Move template to jinja
●   Seriously thinking of moving to mongodb
●   Seriously still trying to see a better way to
    scrape websites

Más contenido relacionado

La actualidad más candente

ADDO 2019: Looking back at over 10 years of Devops
ADDO 2019:    Looking back at over 10 years of DevopsADDO 2019:    Looking back at over 10 years of Devops
ADDO 2019: Looking back at over 10 years of DevopsKris Buytaert
 
Last Month in PHP - June through Mid-July 2017
Last Month in PHP - June through Mid-July 2017Last Month in PHP - June through Mid-July 2017
Last Month in PHP - June through Mid-July 2017Eric Poe
 
Successful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine RankingsSuccessful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine RankingsJoomla Day South Africa
 
Agile work practices and tools
Agile work practices and toolsAgile work practices and tools
Agile work practices and toolsDaniel Lopes
 
Creating Content in a Pattern Library
Creating Content in a Pattern LibraryCreating Content in a Pattern Library
Creating Content in a Pattern LibraryRachel DeLauder
 
JLayout for extension developers
JLayout for extension developersJLayout for extension developers
JLayout for extension developersRoberto Segura
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Luis Rivera
 

La actualidad más candente (10)

iRail at hack democracy
iRail at hack democracyiRail at hack democracy
iRail at hack democracy
 
ADDO 2019: Looking back at over 10 years of Devops
ADDO 2019:    Looking back at over 10 years of DevopsADDO 2019:    Looking back at over 10 years of Devops
ADDO 2019: Looking back at over 10 years of Devops
 
RealDay: Angular.js
RealDay: Angular.jsRealDay: Angular.js
RealDay: Angular.js
 
Joomla JLayout
Joomla JLayout Joomla JLayout
Joomla JLayout
 
Last Month in PHP - June through Mid-July 2017
Last Month in PHP - June through Mid-July 2017Last Month in PHP - June through Mid-July 2017
Last Month in PHP - June through Mid-July 2017
 
Successful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine RankingsSuccessful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine Rankings
 
Agile work practices and tools
Agile work practices and toolsAgile work practices and tools
Agile work practices and tools
 
Creating Content in a Pattern Library
Creating Content in a Pattern LibraryCreating Content in a Pattern Library
Creating Content in a Pattern Library
 
JLayout for extension developers
JLayout for extension developersJLayout for extension developers
JLayout for extension developers
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
 

Destacado

Why I liked Mezzanine CMS
Why I liked Mezzanine CMSWhy I liked Mezzanine CMS
Why I liked Mezzanine CMSRenyi Khor
 
Django tips & tricks
Django tips & tricksDjango tips & tricks
Django tips & tricksRenyi Khor
 
Mezzanine簡介 (at) Taichung.py
Mezzanine簡介 (at) Taichung.pyMezzanine簡介 (at) Taichung.py
Mezzanine簡介 (at) Taichung.pyMax Lai
 
Get ready for dreamforce 2012
Get ready for dreamforce 2012Get ready for dreamforce 2012
Get ready for dreamforce 2012sfdcbestpractices
 
Web micro-framework BATTLE!
Web micro-framework BATTLE!Web micro-framework BATTLE!
Web micro-framework BATTLE!Richard Jones
 
Machine Learning and Deep Learning with R
Machine Learning and Deep Learning with RMachine Learning and Deep Learning with R
Machine Learning and Deep Learning with RPoo Kuan Hoong
 
SXSW 2014: Re-orientating UX Design for the Internet of Things
SXSW 2014: Re-orientating UX Design for the Internet of ThingsSXSW 2014: Re-orientating UX Design for the Internet of Things
SXSW 2014: Re-orientating UX Design for the Internet of ThingsAlfred Lui
 
Overcome the 6 Traps of Agile
Overcome the 6 Traps of AgileOvercome the 6 Traps of Agile
Overcome the 6 Traps of AgileDavid Hawks
 
Customer Churn Analytics using Microsoft R Open
Customer Churn Analytics using Microsoft R OpenCustomer Churn Analytics using Microsoft R Open
Customer Churn Analytics using Microsoft R OpenPoo Kuan Hoong
 
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016Stanford University
 

Destacado (12)

Why I liked Mezzanine CMS
Why I liked Mezzanine CMSWhy I liked Mezzanine CMS
Why I liked Mezzanine CMS
 
All you need is...Mezzanine!
All you need is...Mezzanine!All you need is...Mezzanine!
All you need is...Mezzanine!
 
Django tips & tricks
Django tips & tricksDjango tips & tricks
Django tips & tricks
 
Mezzanine簡介 (at) Taichung.py
Mezzanine簡介 (at) Taichung.pyMezzanine簡介 (at) Taichung.py
Mezzanine簡介 (at) Taichung.py
 
Get ready for dreamforce 2012
Get ready for dreamforce 2012Get ready for dreamforce 2012
Get ready for dreamforce 2012
 
Web micro-framework BATTLE!
Web micro-framework BATTLE!Web micro-framework BATTLE!
Web micro-framework BATTLE!
 
Flask vs. Django
Flask vs. DjangoFlask vs. Django
Flask vs. Django
 
Machine Learning and Deep Learning with R
Machine Learning and Deep Learning with RMachine Learning and Deep Learning with R
Machine Learning and Deep Learning with R
 
SXSW 2014: Re-orientating UX Design for the Internet of Things
SXSW 2014: Re-orientating UX Design for the Internet of ThingsSXSW 2014: Re-orientating UX Design for the Internet of Things
SXSW 2014: Re-orientating UX Design for the Internet of Things
 
Overcome the 6 Traps of Agile
Overcome the 6 Traps of AgileOvercome the 6 Traps of Agile
Overcome the 6 Traps of Agile
 
Customer Churn Analytics using Microsoft R Open
Customer Churn Analytics using Microsoft R OpenCustomer Churn Analytics using Microsoft R Open
Customer Churn Analytics using Microsoft R Open
 
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016
Fatal journeys (Team 621) Lessons Learned H4Dip Stanford 2016
 

Similar a How we use Bottle and Elasticsearch

Python in Industry
Python in IndustryPython in Industry
Python in IndustryDharmit Shah
 
Kentico Cloud Best Practices
Kentico Cloud Best PracticesKentico Cloud Best Practices
Kentico Cloud Best PracticesKentico Software
 
Super lazy side projects - Hamik Mukelyan
Super lazy side projects - Hamik MukelyanSuper lazy side projects - Hamik Mukelyan
Super lazy side projects - Hamik MukelyanDrew Malone
 
Devoxx France - Web Components, Polymer et Material Design
Devoxx France -  Web Components, Polymer et Material DesignDevoxx France -  Web Components, Polymer et Material Design
Devoxx France - Web Components, Polymer et Material DesignHoracio Gonzalez
 
Prototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at SingaporePrototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at SingaporeDhruv Gohil
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec PolymerHoracio Gonzalez
 
Mixing Plone and Django for explosive results
Mixing Plone and Django for explosive resultsMixing Plone and Django for explosive results
Mixing Plone and Django for explosive resultsSimone Deponti
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present futurelolopetit
 
Community and Github: 7/27/2011
Community and Github: 7/27/2011Community and Github: 7/27/2011
Community and Github: 7/27/2011Andy Lester
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache SparkHolden Karau
 
Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Horacio Gonzalez
 
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)Holden Karau
 
Kubernetes: The Very Hard Way
Kubernetes: The Very Hard WayKubernetes: The Very Hard Way
Kubernetes: The Very Hard WayRob Boll
 
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondGetting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondDatabricks
 
About order form improvements
About order form improvementsAbout order form improvements
About order form improvementsGengo
 
Introduction to Gengo's New Order Form tech
Introduction to Gengo's New Order Form techIntroduction to Gengo's New Order Form tech
Introduction to Gengo's New Order Form techGengo
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021StreamNative
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance ComputingLuciano Mammino
 
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)
Build, deploy and scale: Django, GraphQL and SPA  (DjangoCon EU 2021)Build, deploy and scale: Django, GraphQL and SPA  (DjangoCon EU 2021)
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)Dhilipsiva DS
 

Similar a How we use Bottle and Elasticsearch (20)

Python in Industry
Python in IndustryPython in Industry
Python in Industry
 
Kentico Cloud Best Practices
Kentico Cloud Best PracticesKentico Cloud Best Practices
Kentico Cloud Best Practices
 
Super lazy side projects - Hamik Mukelyan
Super lazy side projects - Hamik MukelyanSuper lazy side projects - Hamik Mukelyan
Super lazy side projects - Hamik Mukelyan
 
Devoxx France - Web Components, Polymer et Material Design
Devoxx France -  Web Components, Polymer et Material DesignDevoxx France -  Web Components, Polymer et Material Design
Devoxx France - Web Components, Polymer et Material Design
 
Prototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at SingaporePrototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at Singapore
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
 
Mixing Plone and Django for explosive results
Mixing Plone and Django for explosive resultsMixing Plone and Django for explosive results
Mixing Plone and Django for explosive results
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
 
Community and Github: 7/27/2011
Community and Github: 7/27/2011Community and Github: 7/27/2011
Community and Github: 7/27/2011
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
 
Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18
 
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)
 
Kubernetes: The Very Hard Way
Kubernetes: The Very Hard WayKubernetes: The Very Hard Way
Kubernetes: The Very Hard Way
 
Me&g@home
Me&g@home Me&g@home
Me&g@home
 
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondGetting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
 
About order form improvements
About order form improvementsAbout order form improvements
About order form improvements
 
Introduction to Gengo's New Order Form tech
Introduction to Gengo's New Order Form techIntroduction to Gengo's New Order Form tech
Introduction to Gengo's New Order Form tech
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)
Build, deploy and scale: Django, GraphQL and SPA  (DjangoCon EU 2021)Build, deploy and scale: Django, GraphQL and SPA  (DjangoCon EU 2021)
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)
 

Más de swee meng ng

Civic tech in malaysia and beyond
Civic tech in malaysia and beyondCivic tech in malaysia and beyond
Civic tech in malaysia and beyondswee meng ng
 
High Level View of Civic Tech
High Level View of Civic TechHigh Level View of Civic Tech
High Level View of Civic Techswee meng ng
 
Build website in_django
Build website in_django Build website in_django
Build website in_django swee meng ng
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to djangoswee meng ng
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5swee meng ng
 

Más de swee meng ng (9)

Civic tech in malaysia and beyond
Civic tech in malaysia and beyondCivic tech in malaysia and beyond
Civic tech in malaysia and beyond
 
High Level View of Civic Tech
High Level View of Civic TechHigh Level View of Civic Tech
High Level View of Civic Tech
 
Python on pi
Python on piPython on pi
Python on pi
 
Lvl.up
Lvl.upLvl.up
Lvl.up
 
Data prospecting
Data prospectingData prospecting
Data prospecting
 
Hackerspacekl
HackerspaceklHackerspacekl
Hackerspacekl
 
Build website in_django
Build website in_django Build website in_django
Build website in_django
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
 
introduction to linux desktop draft 5
introduction to linux desktop draft 5introduction to linux desktop draft 5
introduction to linux desktop draft 5
 

Último

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

How we use Bottle and Elasticsearch

  • 1. How We Use Bottle and Elasticsearch An Adventure in Sinar Project
  • 2. A background of Malaysian Bill Watcher ● The big idea, is to let citizen knows what is happening in parliament, bills being debated and pass ● No it doesn't know the bills that is not debated yet. ● Its is scraper based, just because the parliament site tend to be stand alone, and nobody bother to go there. ● And cheat on twitter notification
  • 3. The result ● Didn't quite worked out. ● That is not the point of this talk ● You can talk to us later on this
  • 4. What we use? ● We use bottle micro framework. ● Elasticsearch via pyes ● sqlalchemy for db abstraction(seriously thinking to move to mongodb instead, idea?) ● We use bootstrap for css and their js plugin ● with jquery ● Beaufifulsoup for scraping(that is our data source) We only going to cover pyes and bottle (talk to me later for everything else)
  • 5. Bottle ● A micro framework ● Similar to flask!!! ● Less feature though ● But it is OKAY.
  • 6. Bottle a views ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/pages.py ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/pages.py
  • 7. What happen? ● Bottle can return a dict, and it automatically output json, if the object in dict is compatible ● Or with View Decorator, the dict can be feed to a template
  • 8. bottle the template ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/views/list.tpl ●
  • 9. What happen? ● Bottle read template from a dict/object ● like most templating language does. ● Have some logic like other, different syntax same idea ● Don't have good inheritance though
  • 10. elasticsearch!!! ● OK I lied, this is written in JAVA ● But hey, it got RESTful API ● and pyes did a lot of the stuff for us already
  • 11. Before index ● before we do that ● we don't need to create a schema ● But we do it because we can control the search priority
  • 12. Indexer ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/indexer.py
  • 13. then we index ● First flatten your result ● convert to dict ● index
  • 14. The indexer ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/indexer.py ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/loader.py
  • 15. now we search!!!! ● There is some field inside the search result ● https://github.com/Sinar/Malaysian-Bill- Watcher/blob/master/billwatcher/pages.py
  • 16. The future ● Do localization ● Find new data source ● Move template to jinja ● Seriously thinking of moving to mongodb ● Seriously still trying to see a better way to scrape websites