Image credits: @Mukesh
I attended Pycon India during last couple
of days. As always, it felt great to meet so many
smart programmers creating amazing things. These
are my notes from various workshops, talks and
In an interaction with @Gaurav, he
mentioned about Behave library - “it is
for behaviour-driven development. It is so
intuitive that even a non techy person can write
specs for your code.” The concept sounds
interesting for writing browser tests with Selenium.
@Shashank gave a workshop on “scraping
even the hardest websites.” Though I have used
BeautifulSoup before, using Selenium with
PhantomJS was a new learning. Another interesting note
from the talk was using
DeathByCaptcha API for solving
captchas on websites.
So now my workflow for scraping websites is
something like this:
- Traditional GET requests
- Forms / POST requests
(to go around CSRF and ASP websites).
- Modern single-page-websites
- It probably has REST APIs - use them.
- Selenium + PhantomJS.
In another workshop, @Anand not only
explained us how decorators work, but also
made us do lots of exercises. One can go
through the notebook here. By the end
of the workshop we learned to write our own trace,
memorize / cache and routing decorators.
Apart from decorators, I also learned about
various magic commands in IPython Notebook:
# Python Code
# below it will save the code
# in the given filename
# using ! we can run bash-commands
# To see all the available magic commands in IPython
# (found in an interaction with Eswar Vandanapu)
@Kushal gave a keynote on the importance
of contributing upstream. By going through the
source codes of our favorite programs, we can not
only become a better programmer but also get an
opportunity to contribute to them. I pledge to have
a closer look at the source codes of two of my
favorite Python packages - Rhythmbox and Django.
Guys from IIT Bhu talked about using
SimpleCV to play flappy-birds using
gestures. The library looks quite powerful to do
some interesting stuff with cameras and images. I
have a few toy-ideas in my mind now
- will see how they go.
@Kiran shared the problems he faced while
creating LastUser service. I learned about
database-backed sessions and about how they differ
from cookie based sessions. Kiran also emphasized
on using HTTPS by showing how easy it was to
hijack sessions using FireSheep on an unsecured network.
Django uses database-backed sessions by default.
While digging into the related documentation, I
found the solution to some of my problems
Second keynote speaker, @Michael Foord,
emphasized on moving the projects from
platform-as-a-service (such as Heroku other such
hostings) to infrastructure-as-a-service (such as
Amazon AWS). A hosting service should be
considered as livestock or sheep instead of as
pet. It should be easily migratable and
redeployable whenever needed. Docker and JuJu are
steps towards that.
@S Anand presented a talk on “faster
data processing in python.” He began with basic
pieces of codes and then optimized them
incrementally - explaining the measurement
techniques and conceptual approach towards
optimization. The complete talk can be viewed
online, while the notebook is available here.
Few important libraries mentioned in the talk were:
- Shows the number of hits and time spent on
each line of code.
- Pandas and Numpy
- For performing vector operations.
- Numba @jit decorator
- Converts a Python function to efficient machine instruction.
During the lightning talks, @Vineet showcased his
library Pipdeptree, which displays all the pip
dependencies in a tree format. It will surely come
quite handy for generating sane
@Ankur showcased his awesome new project
ImportPython.com - a customized
Python weekly newsletter. Apart from that, the
website lists all the Python books (free as well
as paid) categorized by reader’s levels. In future
he plans to bring everything else, including
videos, presentations etc. related to Python at
Together, this is a long list of new libraries and
concepts to try-out and practice. It should keep
me busy well until the next PyCon.