Sessions at PyCon US 2012 matching your filters

Your current filters are…

Clear
  • Pragmatic Unicode, or, How do I stop the pain?

    by Ned Batchelder

    Python has great Unicode support, but it's still your responsibility to handle it properly. I'll do a quick overview of what Unicode is, but only enough to get your program working properly. I'll describe strategies to make your code work, and keep it working, without getting too far afield in Unicode la-la-land.

    Python has great Unicode support, but it's still your responsibility to handle it properly. Even expert programmers get tripped up with the encodings and decodings that can happen implicitly, throwing errors in unexpected places.

    This talk will present a quick overview of what Unicode is, why it exists, and how it works, but only enough to get your program working properly. Unicode can be intricate and fascinating, but really, who cares? You just want your code to work without throwing a UnicodeEncodeError every time an accented character sneaks in somehow.

    I'll describe strategies to make your code work, and keep it working, without getting too far afield in Unicode la-la-land.

    How Unicode is handled is one of the biggest changes in Python 3. I'll touch on what those changes are, and how you can use them to keep even your Python 2 code running smoothly.

    Outline
    Bytes vs. text
    ASCII, 8859-1, etc.
    Unicode
    Encodings
    Python 2: str vs unicode
    encode and decode
    implicit conversions!!
    Python 3: bytes vs str
    Everybody's happy!

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

    In E3, 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

  • Militarizing Your Backyard with Python: Computer Vision and the Squirrel Hordes

    by Kurt Grandis

    Has your garden been ravaged by the marauding squirrel hordes? Has your bird feeder been pillaged? Tired of shaking your fist at the neighbor children? Learn how to use Python to tap into computer vision libraries and build an automated sentry water cannon capable of soaking intruders.

    Using the Python bindings for the computer vision library, OpenCV, we will investigate the components and steps needed to power a sentry gun. In addition to basic object and motion tracking, concepts of object recognition (friend or foe) will be discussed. Communication and control of the underlying hardware is performed using Python and will also be covered.

    Additional peace-time applications of the above technology will be demonstrated.

    • OpenCV
    • Object detection
    • Motion tracking
    • Friend-or-foe object recognition
    • Stereo vision
    • Building training sets with Amazon Mechanical Turk
    • Python-Arduino communication
    • Python + Kinect

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

    In D5, 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
    Full GET/POST/PUT/DELETE/PATCH
    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

  • Spatial data and web mapping with Python

    by Paul Smith

    Spatial data are often seen as opaque to most developers, and while dealing with them does require a shift in approach from the data types we most regularly handle, they needn’t be the domain of specialists. High-quality Python libraries and Python-based applications exist for operating on and transforming spatial data, and for creating visualizations, including maps for presentation on the web.

    This talk will be an overview of the Python libraries and applications available for handling spatial and geospatial data and creating maps for the web. It will cover libraries for open and transforming spatial data formats and representations, spatial operators and predicates for queries and relationships, spatial indexes for efficient queries, and compositing and rendering map tiles, as well as desktop applications extensible with Python that replace much of the functionality of "enterprise" GIS software.

    At 4:00pm to 4:55pm, Saturday 10th March

    In E3, Santa Clara Convention Center

  • What Python can learn from Java

    by Jonathan Ellis

    Java is in some ways a bogeyman to the Python community -- the language that parents scare their children with, the Cobol of the 21st century. But if we look past the cesspool of JEE it turns out that Java has quietly become an excellent systems environment, one that is still in many ways ahead of its time.

    • Introduction
    • The difference between systems and web (and scientific) computing
    • Why Pythonistas should care about systems programming
    • Concurrency
    • Why "just use multiple processes" is inadequate
    • Why event loops are inadequate
    • java.util.concurrent: low level (collections, synch primitives)
    • j.u.c.: high level (executors, futures, fork/join)
    • The VM
    • State of the art GC
    • Built-in (and extensible) telemetry
    • More functional than Python?!
    • immutability
    • Guava: com.google.*

    At 4:55pm to 5:30pm, Saturday 10th March

    In E1, Santa Clara Convention Center