Sessions at PyCon US 2012 with slides and video in E4

Your current filters are…


Friday 9th March 2012

  • Data, Design, Meaning

    by Idan Gazit

    The ultimate goal of data visualization is to tell a story and supply meaning. There are tools and science that can inform your choice of data to present and how best to present it. We reflexively evaluate data and fit it into a narrative which aids decisionmaking; learn how to take advantage of this tendency in order to deliver meaning, not just numbers and charts.

    Data visualization is a hot field right now—and for good reason. In our age of info-saturation, true value is found in distilling large amounts of data into a form that is easy to comprehend and act upon. This talk provides an overview of tools and techniques which you can use to level up your data presentation, regardless of application.

    As humans, we are adept at evaluating visual information. From an early age, we learn to make inferences about things based on their visual properties—large and small, near and far, motion, direction, and other attributes. Taking advantage of the visual process we’ve been practicing since birth is an easy way to optimize delivery of your data into the brains of your audience.

    Unfortunately, it isn’t enough to appeal to the part of our brains responsible for figuring out whether we can successfully hit an animal with a rock. A great visualization must appeal to our sense of beauty. Structure, layout, typography, and color are all tools which can be used (and abused) to delight your audience and direct their attention where you want it to go.

    Whether you’re building an information dashboard for a webapp or presenting scientific data, an understanding of these techniques will make your data more accessible to your audience, and more of a delight to read and learn from.

    At 12:10pm to 12:55pm, Friday 9th March

    In E4, Santa Clara Convention Center

  • Build reliable, traceable, distributed systems with ZeroMQ

    by Jérôme Petazzoni

    We will show how to build simple yet powerful RPC code with ZeroMQ, with very few (if any!) modification to existing code. We will build fan-in and fan-out topologies with ZeroMQ special socket types to implement PUB/SUB patterns and scale up job-processing tasks. Thanks to introspection, the resulting services will be self-documented. Finally, we will show how to implement distributed tracing.

    We will show how to leverage ZeroMQ to build a simple yet powerful RPC for Python code. We will focus on simplicity, the goal being to expose almost any Python module or class to network calls – with very few (if any!) modification to existing code.

    We will then explain the purpose and show some use-cases for ZeroMQ special socket types (PUSH/PULL, PUB/SUB, ROUTER/DEALER) to build fan-in and fan-out topologies, as well as asynchronous processing (to avoid blocking when doing long-running requests). A by-product is the ability to scale up job-processing tasks with a message queue, which can even be made broker-less (you don’t have to deploy heavy machinery if you don’t need it).

    We will also demonstrate how introspection can make development and debugging easier, exposing docstrings, and provideing a few command-line helpers to poke, debug, and experiment directly from the shell.

    At the end of the talk (or in a separate talk), we will explain how to implement a tracing framework for distributed RPC. By hooking into the right places, we will show how to get full tracebacks and profiling information; more precisely:

    how each complex call (involving multiple subcalls) can be accurately traced;
    how to handle exceptions, and know easily when and where they happened (without checking dozens of log files);
    which complex calls take too long, and where they spend their time (distributed profiling).
    Those guidelines are the result of an on-going development work at dotCloud, and actively used and implemented at the core of our leading Platform-as-a-Service offering.

    We don’t expect the audience to be familiar with ZeroMQ or RPC. However, it will certainly help to have basic knowledge of serialization (e.g. pickle) and sockets.

    At 2:00pm to 2:40pm, Friday 9th March

    In E4, Santa Clara Convention Center

Saturday 10th March 2012

  • Django Templating: More Than Just Blocks

    by Christine Cheung

    Django's template language is designed to strike a balance between power and ease of use; learn how to use this balance to create awesome looking websites. This talk will cover the basics and best practices of Django templating, from custom tag and filter creation, to the finer points of template rendering and loading, and even to replacing the default templating engine itself.

    Harness the power of Django templates to help present your data with ease! Learn about:
    Basic block formations, common patterns, and using includes wisely.
    Tips and tricks in using the built-in template tags and filters.
    How to make custom tags and filters: examples, what you should and shouldn’t do, and tools to help the process such as django-classy-tags.
    Different ways to load and render templates.
    Replacing Django’s default template language: pros and cons

    At 10:25am to 11:05am, Saturday 10th March

    In E4, Santa Clara Convention Center

  • Django Form Processing Deep Dive

    by Nathan Yergler

    Django Form processing often takes a back seat to flashier, more visible parts of the framework. But Django forms, fully leveraged, can help developers be more productive and write more cohesive code. This talk will dive deep into the stock Django forms package, as well as discuss a strategy for abstracting validation for forms, and the use of unit and integration tests with forms.

    Django Form processing often takes a back seat to flashier, more visible parts of the framework. But Django forms are an integral part of the framework that can help developers be more productive and write more cohesive, well tested code. This talk will dive deep into the stock Django forms package, providing an examples of:

    • custom validation and validation patterns
    • processing multiple forms at once (form sets)
    • persisting validated form data to models (model forms)

    We'll also discuss ways to build on Django forms, including:

    * writing unit and integration tests for forms, and how writing tests can help you understand code cohesion
    & abstracting validation for forms to provide tiered validation (for example, one set of criteria to save, additional criteria to publish)
    * approaches to working with multiple, heterogeneous forms simultaneously

    At 11:05am to 11:45am, Saturday 10th March

    In E4, Santa Clara Convention Center

  • Testing and Django

    by Carl Meyer

    A deep dive into writing tests with Django, covering Django's custom test-suite-runner and the testing utilities in Django, what all they actually do, how you should and shouldn't use them (and some you shouldn't use at all!). Also, guidelines for writing good tests (with or without Django), and my least favorite things about testing in Django (and how I'd like to fix them).

    Django has a fair bit of custom test code: a custom TestSuiteRunner, custom TestCase subclasses, some test-only monkeypatches to core Django code, and a raft of testing utilities. I'll cover as much of that code as I find interesting and non-trivial, taking a close look at what it's actually doing and what that means for your tests.

    This will be a highly opinionated talk. There are some things in Django's test code I really don't like; I'll talk about why, and how I'd like to see them changed. As a natural part of this, I'll also be outlining some principles I try to follow for writing effective and maintainable tests, and note where Django makes it easy or hard.

    This is an "extreme" talk, so I'll be assuming you've used Django and done some testing, and you're familiar with the basic concepts of each. This won't be an introductory "testing with Django" howto.

    At 11:45am to 12:30pm, Saturday 10th March

    In E4, Santa Clara Convention Center

  • Web Server Bottlenecks And Performance Tuning

    by Graham Dumpleton

    New Python web developers seem to love running benchmarks on WSGI servers. Reality is that they often have no idea what they are doing or what to look at. This talk will look at a range of factors which can influence the performance of your Python web application. This includes the impact of using threads vs processes, number of processors, memory available, the GIL and slow HTTP clients.

    A benchmark of a hello world application is often what developers use to make the all important decision of what web hosting infrastructure they use. Worse is that in many cases this is the only sort of performance testing or monitoring they will ever do. When it comes to their production applications they are usually flying blind and have no idea of how it is performing and what they need to do to tune their web application stack.

    This talk will discuss different limiting factors or bottlenecks within your WSGI server stack and system that can affect the performance of your Python web application. It will illustrate the impacts of these by looking at typical configurations for the more popular WSGI hosting mechanisms of Apache/mod_wsgi, gunicorn and uWSGI, seeing how they perform under various types of traffic and request loads and then tweaking the configurations to see whether they perform better or worse.

    Such factors that will be discussed will include:

    Use of threads vs processes.
    Number of processors available.
    Python global interpreter lock (GIL)
    Amount of memory available.
    Slow HTTP browsers/clients.
    Browser keep alive connections.
    Need to handle static assets.
    From this an attempt will be made to provide some general guidelines of what is a good configuration/architecture to use for different types of Python web applications. The importance of continuous production monitoring will also be covered to ensure that you know when the performance of your system is dropping off due to changing traffic patterns as well as code changes you have made in your actual web application.

    At 1:35pm to 2:15pm, Saturday 10th March

    In E4, Santa Clara Convention Center

  • RESTful APIs With Tastypie

    by Daniel Lindsley

    Providing full-featured REST APIs is an increasingly popular request. Tastypie allows you to easily implement a customizable REST API for your Python or Django applications.

    Who am I? (Primary author of Tastypie)
    Why REST?
    A touch of philosophy

    Use HTTP the best we can
    Flexible serialization (not everyone wants JSON)
    What you can GET should be able to be POST/PUT
    Should be reasonable by default but easy to extend
    URIs Everywhere!
    Why Tastypie?

    Works with Django
    Any data source (Not just ORM)
    Designed to be extensible
    Supports a variety of serialization formats (JSON/XML/YAML/bplist)
    URIs everywhere by default
    Lots of hooks for customization
    Demonstrate a simple setup

    Then explore the API based on that trivial setup
    Demonstrate adding authentication/authorization

    Demonstrate adding custom serialization
    Demonstrate adding a different data source
    Demonstrate adding a custom endpoint

    At 2:15pm to 2:55pm, Saturday 10th March

    In E4, Santa Clara Convention Center