PyCon Canada 2018

Samantha Campbell
Bungalow Garage
Published in
3 min readNov 15, 2018

Highlights from PyCon Canada 2018

Photo by Chivalry Creative on Unsplash

November 10th and 11th the Bungalow Engineering team was in Toronto, Ontario at PyCon Canada 2018!

This two day conference had a variety of talks and streams appropriate for both beginners and experts. The topics ranged from the state of quantum computing in Python to how to properly write conditional statements. It was also an excellent opportunity to network with the larger Python community.

Unfortunately, it’s impossible to attend every talk! While we wait for the videos here are highlights of a few of the many great presentations we attended.

How Mozilla uses Python to build and ship Firefox

Chris Atlee(@ChrisAtlee)

Firefox releases versions ALL. THE. TIME. Approximately 20 per month. Each release can have over 7000 different tasks and generate 50–100GB of artifacts.

Keeping users up-to-date is clearly important. Firefox has an update server (named Balrog) that handles approximately 5000 requests per second. Firefox queries Balrog regularly to see if updates are available. Updates need to follow a specific flow and some are important and forced. All powered by Python!

So why does Mozilla like Python?

  • The speed of development and ease of use
  • The large community of Python module maintainers
  • The extensive tooling and available frameworks

Where are some other places Mozilla is using Python?

  • symbols.mozilla.org
  • support.mozilla.org
  • MDN (Mozilla Developer Network)

Software Design Simplified

Alex Tucker (@_AlexTucker)

How do you decrease complexity as more features are added to your product? If you are from the world of object-oriented programming you know that:

  1. Modelling is hard
  2. Developers don’t always have the luxury of time to be correct
  3. There are a lot of bad coding patterns
  4. It’s very easy to bloat systems and turn to too many micro-services

So what do you do? A simple pattern is to decouple data from behaviour in your objects. “Don’t build the whole car in one object”.

A value object contains just data, with no behaviour. This is useful for easy validation.

A service object is a collection of stateless methods. These objects have no data.

An advanced implementation of this would use multiple layers. Layers enable composition (putting multiple objects together) without creating a “God Object” (i.e. the whole car). You’re view layer can call your service layer which interacts with your system backend. You can add additional layers as intentional complexity. For example an orchestration layer could be added between your views and service layers to call services. To avoid race conditions using this approach, a good rule is that calls shouldn’t occur in the same layer and calls should not go “up” layers.

Investigating Ticket Scalping

Valérie Ouellet (@valerie_ouellet)

CBC News Article: https://www.cbc.ca/news/business/tickets-scalping-blue-jays-1.4597286

Data journalism at CBC uses exclusive data for news reports and shows like CBC Marketplace. There was an investigation into a secret scalper program for Blue Jays game tickets. It was thought that many tickets were being bought and resold by scalpers. Data journalists used Python to gather data needed for the report.

Bots would scrape the Ticketmaster site for base prices. They created a unique ticket ID using common information among platforms like section, row, and seat (i.e. something like sec_2_row_A_seat_13). Bots would then scrape reseller sites daily such as StubHub and Tickets Now to track if the ticket was being resold and at what price. All the data was merged together using Ticketmaster as the base price to create a custom dictionary that could then be cleaned. They went the extra step of mapping out the stadium to see if there was a correlation between certain seats and their chances of being scalped.

There were of course caveats with this data such as missing fields and interruptions with the scraping. If they did the site scraping right when tickets were released the network was congested and many times their connection was severed.

All this data, along with real people sources, concluded that two thirds of tickets for a home opener game had been bought and resold.

That’s a wrap!

Bungalow was among some amazing sponsors for PyCon Canada 2018! Are you passionate about open source conferences? So are we! Join our growing team, see our careers page for open roles.

--

--

Samantha Campbell
Bungalow Garage

Frontend Developer, Crafter, Community Organizer, Crazy Cat Lady