Get Lanyrd on your mobile (iPhone, Android and more) - check it out here

Sessions at PyCon US 2012 matching your filters

Your current filters are…

Clear

Wednesday 7th March 2012

  • Introduction to Django

    by Chander Ganesan

    The Django framework is a fast, flexible, easy to learn, and easy to use framework for designing and deploying web sites and services using Python. In this session, we'll cover the fundamentals of development with Django, generate a Django data model, and put together a simple web site using the framework.

    • Detailed Tutorial Outline
    • Django Overview and Basic Introduction
    • Downloading & Installing Django
    • Creating a new project
    • Choosing a database
    • Creating a new application
    • Installing & Using Django contrib applications
    • Overview of Django flow (i.e., URLconf expression, view function, HTTPResponse object, etc.)
    • Generating Simple Django Views
    • Configuring a URLConf for basic views
    • Creating Django Templates (template syntax, common filters and tags, loops, etc)
    • Creating & using Template Context objects
    • Introduction to Django Models
    • Defining basic Django models
    • Understanding basic model fields & options
    • Generating & Reviewing Model SQL
    • Adding data to a model
    • Simple data retrieval using models
    • Working with QuerySets (filters, slicing, ordering, common methods)
    • Overview of Q objects)
    • Using the Admin interface
    • Using Generic views
    • Access control with sessions & users

    At 9:00am to 12:20pm, Wednesday 7th March

    In H3, Santa Clara Convention Center

  • Introduction to Event Driven Programming Using Twisted

    by Jean-Paul Calderone

    This tutorial introduces programmers with a basic Python skills to the concepts and techniques of event driven programming. The focus is on understanding an event loop and handling the events related to TCP connections. Twisted is introduced as a re-usable event loop implementation and the abstract concepts of event driven programming are related to specific uses of the Twisted library.

    • What is event driven programming
    • What is it an alternative to
    • What are its advantages
    • How does an event loop work
    • Build one step by step to demonstrate
    • Demonstrate a server which can handle many clients
    • Demonstrate a client which can run in the same event loop
    • Demonstrate timed events in the event loop
    • How are event handlers connected to form a program
    • Callback functions
    • Deferreds
    • Generator tricks - inlineCallbacks
    • Coroutines - stackless, corotwine
    • More

    At 9:00am to 12:20pm, Wednesday 7th March

    In D3, Santa Clara Convention Center

    Coverage slide deck

Thursday 8th March 2012

  • High Performance Python I

    by Ian Ozsvald

    At EuroPython 2011 I ran a very hands-on tutorial for High Performance Python techniques. This updated tutorial will cover profiling, PyPy, Cython, numpy, NumExpr, ShedSkin, multiprocessing, ParallelPython and pyCUDA. Here's a 55 page PDF write-up of the EuroPython material: http://ianozsvald.com/2011/07/25...

    At EuroPython 2011 I ran a very hands-on tutorial for High Performance Python techniques. This updated tutorial will cover:

    • profiling with cProfile, run_snake and line_profiler
    • PyPy
    • Cython
    • numpy with and without vectors
    • NumExpr
    • ShedSkin Py->C++ compiler
    • multiprocessing for multi-core
    • ParallelPython for multi-machine
    • pyCUDA demos

    I plan to expand the original material and to maybe also cover other tools like execnet and PyPy-numpy.

    At 9:00am to 12:20pm, Thursday 8th March

    In D2, Santa Clara Convention Center

  • Optimize Performance and Scalability with Parallelism and Concurrency

    by Robert Hancock

    From how the operating system handles your requests through design principles on how to use concurrency and parallelism to optimize your program's performance and scalability. We will cover processes, threads, generators, coroutines, non-blocking IO, and the gevent library.

    How processes, threads, coroutines, and non-blocking IO work from the operating system through code implementation and design principles to optimize Python programs. The difference between parallelism and concurrency and when to use each.

    The premise is that to make an informed decision you need to know what is happening under the hood. Once you understand the low level functionality, you can make the correct decision in the design phase.

    The emphasis is on practical application to solve real world problems.

    Outline

    • How the operating system handles traps and interrupts
    • Scheduling
    • Processes
    • Threads
    • The GIL
    • Generators
    • What is a coroutine?
    • What is a Python coroutine?
    • Blocking/Non-blocking I/O.
    • Parallelism versus Concurrency
    • How do these work with CPython, Pypy, and Stackless
    • Greenlets and libevent (gevent)
    • Design principles
    • Example networked application
    • Performance results
    • What are other the other options?

    At 9:00am to 12:20pm, Thursday 8th March

    In F2, Santa Clara Convention Center

Friday 9th March 2012

  • Practical Machine Learning in Python

    by Matt Spitz

    There are a plethora of options when it comes to deciding how to add a machine learning component to your python application. In this talk, I'll discuss why python as a language is well-suited to solving these particular problems, the tradeoffs of different machine learning solutions for python applications, and some tricks you can use to get the most out of whatever package you decide to use.

    This is the age of data. As more companies expose their datasets through APIs, it's becoming increasingly easier to pull information about users, places, and things. But having this data isn't always enough; we want to understand it, find correlations, and identify trends. Fortunately, the area of computer science known as machine learning has a variety of algorithms specifically designed to do this sort of data wrangling. For the python application developer, there are many off-the-shelf toolkits that include implementations of these algorithms (Orange, NLTK, SHOGUN, PyML and scikit-learn to name just a few), but choosing which one to use can be daunting.

    There are a number of tradeoffs one makes when making a selection, depending on the specifics of the implementation and the needs of the application. In this talk, I'll give an overview of some of the packages available and discuss what factors might go into deciding which one to use. I'll also offer some python-specific tricks you can use to work with large amounts of data efficiently.

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

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

  • Code Generation in Python: Dismantling Jinja

    by Armin Ronacher

    For many DSLs such as templating languages it's important to use code generation to achieve acceptable performance in Python. The current version of Jinja went through many different iterations to end up where it is currently. This talk walks through the design of Jinja2's compiler infrastructure and why it works the way it works and how one can use newer Python features for better results.

    Why Code Generation?
    It seems like the general consensus for code generation in many dynamic language communities is: eval is evil, do not use it. However if done properly code generation solves a lot of problems easily, securely and with much better performance than an interpreter written on top of an interpreted language like Python.

    Code generation is what powers most template languages in Python, what powers object relational mappers and more. It is also an excellent tool to simplify debugging.

    Why Codegen is no Silver Bullet
    Just because you generate code does not mean you're faster than an interpreter written in Python. This part of the talk focuses on why compiling Django templates to Python bytecode does not automatically make it fast.

    Design of Jinja2
    Jinja2 underwent multiple design iterations, most of which were made to either improve performance or debug-ability. The internals however are largely undocumented and confusing unless you're familiar with the code. In it however are a few gems hidden and interesting tricks to make code generation work in the best possible way.

    Python's Support for Code Generation
    Over the years Python's support for code generation was steadily improved with different ways to access the abstract syntax tree and to compiling it back to bytecode. This section highlights some alternative ways to do code generation that are not yet fully implemented in Jinja2 but are otherwise widely used.

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

    In E2, Santa Clara Convention Center

  • Apache Cassandra and Python

    by Jeremiah Jordan

    Using Apache Cassandra from Python is easy to do. This talk will cover setting up and using a local development instance of Cassandra from Python. It will cover using the low level thrift interface, as well as using the higher level pycassa library.

    • Very brief intro to Apache Cassandra
    • What is Apache Cassandra and where do I get it?
    • Using the Cassandra CLI to setup a keyspace (table) to hold our data
    • Installing the Cassandra thrift API module
    • Using Cassandra from the thrift API
    • Connecting
    • Writing
    • Reading
    • Batch operations
    • Installing the pycassa module
    • Using Cassandra from the pycassa module
    • Connecting
    • Reading
    • Writing
    • Batch operations
    • Indexing in Cassandra
    • Automatic vs Rolling your own
    • Using Composite Columns
    • Setting them up from the CLI
    • How to using them from pycassa
    • Lessons learned

    At 2:40pm to 3:20pm, Friday 9th March

    In E2, Santa Clara Convention Center

  • Decorators and Context Managers

    by Dave Brondsema

    Learn how decorators and context managers work, see several popular examples, and get a brief intro to writing your own. Decorators wrap your functions to easily add more functionality. Context managers use the 'with' statement to make indented blocks magical. Both are very powerful parts of the python language; come learn how to use them in your code.

    Decorators wrap or modify your functions. They are functions themselves, so you can pass parameters to them. You can wrap a function with multiple decorators too. We'll cover how to use decorators in all those situations and how to write them too. Examples will be demonstrated with:

    • @property
    • @memoize
    • mock/patch
    • TurboGears
    • Django
    • Allura

    Context managers wrap a block of code using the 'with' statement to do something on the way into the block and something on the way out. Opening and closing a file is a very common case, but there is a lot more you can do. Examples include:

    • modifying state
    • capturing stdout
    • mock/patch
    • locks
    • timing
    • transactions

    More about decorators: http://www.python.org/dev/peps/p...

    More about context managers: http://www.python.org/dev/peps/p...
    http://docs.python.org/library/c...

    At 3:20pm to 3:50pm, Friday 9th March

    In E3, Santa Clara Convention Center

  • Make Sure Your Programs Crash

    by Moshe Zadka

    With Python, segmentation faults and the like simply don't happen -- programs do not crash. However, the world is a messy, chaotic place. What happens when your programs crash? I will talk about how to make sure that your application survives crashes, reboots and other nasty problems.

    Handling crashes is divided into two parts -- resilience (making sure that your software maintains correctness in the face of crashes) and speed of recovery (optimizing the time it takes back to get back to full working condition). I will talk about techniques to allow for resilience -- separating master data from cache data, minimizing the amount of master data, using atomic file operations, using databases and persisting structures in the right order. Then I will talk about speedy recovery techniques, among them process separation, working while restarting and more. I will conclude with surveying the options in testing all of these things so that the crashes are made to happen in the development/testing environment.

    Outline:

    • Ways Python programs can crash
    • Infinite loops
    • Getting stuck
    • Memory leaks
    • Exceptions
    • Catching exceptions considered scary
    • Threads dead-locks
    • Minimizing effects of a crash
    • Atomic file operations
    • Databases
    • Vertical process splitting
    • Horizontal process splitting
    • Limiting process lifetime
    • Detecting crashes
    • Process death
    • Process inresponsiveness
    • Test communication
    • Helper checker processes
    • Restarting processes
    • Minimize master data
    • Boot-up speed
    • Order of start-up and communication
    • Testing by killing processes
    • Testing by pausing processes
    • Conclusions
    • Python processes can still crash
    • Plan for crashes
    • Test your plan for crashes

    At 3:20pm to 3:50pm, Friday 9th March

    In E1, Santa Clara Convention Center

  • Putting Python in PostgreSQL

    by Frank Wiles

    PostgreSQL is pretty powerful all on it's own, but did you know you can use Python as a stored procedure language? Not only does using a familiar language make development easier, but you get the power of the standard library and PyPi to boot. Come learn the ins and outs of putting Python in your DB.

    Pushing logic in your database can be a blessing or a curse. While these techniques aren't appropriate for most users in most situations, it's good to know what kind of power you have at your disposal with PL/Python if the need ever arises.

    Learn about how to: - Use triggers to off load data processing tasks - Fire off email and log alerts based on what is happening in your tables - Create more granular and detailed constraints such as verifying email address or credit card checksums at the database level - Replace batch jobs with in database triggers - Learn when and when NOT to use these techniques - Debugging techniques - Security concerns

    At 3:20pm to 4:05pm, Friday 9th March

    In E2, Santa Clara Convention Center

  • Introspecting Running Python Processes

    by Adam Lowry

    Understanding the internal state of a running system can be vital to maintaining a high performance, stable system, but conventional approaches such as logging and error handling only expose so much. This talk will touch on how to instrument Python programs in order to observe the state of the system, measure performance, and identify ongoing problems.

    Something is wrong with your web application. The time it’s taking to serve requests is growing. Your logs don’t contain enough. Your database appears bored. How do you know what’s going wrong?

    In high-performance production servers it’s vital to know as much about the internals of your system as possible. Traditionally this is done by simple methods like logging anything of potential interest or sending error emails with unexpected exceptions. These methods are insufficient, both due to the level of noise inherent in such systems and because of the difficulty in anticipating what metrics are important during an incident.

    Environments such as the JVM and .Net VM have advanced tools for communicating with the VM and for applications to expose internal state, but CPython has lacked similar tooling.

    This talk will cover what options CPython application developers have for introspecting their programs; new tools for instrumenting, exposing, and compiling performance and behavior metrics; and techniques for diagnosing runtime issues without restarting the process.

    At 5:20pm to 6:00pm, Friday 9th March

    In E1, Santa Clara Convention Center

Saturday 10th March 2012

  • 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

Sunday 11th March 2012

  • Parsing Horrible Things with Python

    by Erik Rose

    If you've ever wanted to get started with parsers, here's your chance for a ground-floor introduction. A harebrained spare-time project gives birth to a whirlwind journey from basic algorithms to Python libraries and, at last, to a parser for one of the craziest syntaxes out there: the MediaWiki grammar that drives Wikipedia.

    Some languages were designed to be parsed. The most obvious example is Lisp and its relatives which are practically parsed when they hit the page. However, many others—including most wiki grammars—grow organically and get turned into HTML by sedimentary strata of regular expressions, all backtracking and warring with one another, making it difficult to output other formats or make changes to the language.

    We will explore the tools and techniques necessary to attack one of the hairiest lingual challenges out there: MediaWiki syntax. Join me for an introduction to the general classes of parsing algorithms, from the birth of the field to the state of the art. Learn how to pick the right one. Have a comparative look at a dozen different Python parsing toolkits. And finally, learn some optimization tricks to get a grammar going at a reasonable clip.

    At 12:00pm to 12:30pm, Sunday 11th March

    In E3, Santa Clara Convention Center

  • Building A Python-Based Search Engine

    by Daniel Lindsley

    Search is an increasingly common request in all types of applications as the amount of data all of us deal with continues to grow. The technology/architecture behind search engines is wildly different from what many developers expect. This talk will give a solid grounding in the fundamentals of providing search using Python to flesh out these concepts in a simple library.

    • Core concepts
    • Terminology
    • Document-based
    • Show basic starting code for a document
    • Inverted Index
    • Show a simple inverted index class
    • Stemming
    • N-gram
    • Show a tokenizer/n-gram processor
    • Fields
    • Show a document handler which ties it all together
    • Searching
    • Show a simple searcher (& the whole thing working together)
    • Faceting (likely no demo)
    • Boost (likely no demo)
    • More Like This
    • Wrap up

    At 1:30pm to 2:10pm, Sunday 11th March

    In E3, Santa Clara Convention Center

  • Diversity in practice: How the Boston Python Meetup grew to 1000 people and over 15% women

    by Asheesh Laroia and Jessica McKellar

    How do you bring more women into programming communities with long-term, measurable results? In this talk we'll analyze our successful effort, the Boston Python Workshop, which brought over 200 women into Boston's Python community this year. We'll talk about lessons learned running the workshop, the dramatic effect it has had on the local user group, and how to run a workshop in your city.

    The Boston Python Workshop is a project-driven introduction to Python for women and their friends. It has run 6 times with the Boston Python Meetup in the last 12 months, bringing over 200 women into the local Python community. By being fully integrated into the main user group, the workshop has helped the Meetup grow to over 2**10 members and consistently draw over 15% women at its events. We'll talk about lessons learned running the workshop, the dramatic effect it has had on the Boston Python Meetup, and what it takes to run an outreach event in your city.

    At 2:10pm to 2:55pm, Sunday 11th March

    In E2, Santa Clara Convention Center