inpycon09 the success story

When the first discussions happened, everybody doubted it might become just another conference discussion that will never happen. It has taken the support and sheer determination of quite a number of people to make it happen. We just wanted to try it once, to at least see how the Python community responds to such initiatives and it has ended up being more than encouraging to make this a yearly event. This is the simple story of inpycon09.

When I landed at the IISc campus on a not so chilly morning, the posters were up and I could find a few people waiting here and there in the corridors. When I entered nothing was up yet, other than a few volunteers running around putting posters and direction notices. Slowly people started turning up and I could see more known faces. By 9 AM, there were enough crowd to start the registration counter and soon a long queue got formed.

The conference kit consisted of a notepad, ID tag, a pen and a pycon tee. It was a simple white tee, with a caption in the back. Unfortunately we ended up having a spello in it, which indeed made the tee more special 😉 Halls were fast filling up and when Prabhu Ramachandran was delivering the keynote the benches got filled and people started filling up the foot steps as well. It was a very interesting talk, encouraging everyone to go and give a shot with Python. He had also included his associations with ILUGC and how it helped him. He advised people to become a part of an active LUG. His talk was mostly around SciPy and Mayavi.

As the keynote ended, talks in other two halls started, kicking the normal proceedings of the first day of inpycon. Every hall was running full house and we would’ve had around 300 people attending the conference, especially a big bunch of students of REC, Chennai. Kenneth and Noufal took the Introduction to Python talk, leaving me for the second day. There was actually a balance of talks, not just focusing on web development. And the lunch was really good.

A lot of #linux-india guys had turned up and it was surprising to meet them before the normal foss.in season. The first day ended up quite satisfactorily and gave us hopes for the second day to run smoothly. Though we did not have a huge crowd on the second day, and it being only a half day of scheduled talks, it too went calmly. I took the beginners’ introduction to Python, following by Kenneth taking some advanced topics. There was a white sheet posted with post-it notes to be used to express the feedbacks from delegates and we ended up getting some quite interesting, even contradicting opinions posted about the conference. We welcome the criticisms as it helps us to know our holes and stop it from appearing next time.

On the whole, the beta release of inpycon was a satisfying success, leaving my weekend to have not been wasted and giving us the encouragement to come back better next year, may be in Chennai 😉

Advertisements

PyCon India 2009 Discussion #1

DateTime: 03 Mar 2009 9.00 PM (+5.30 UTC)

Location: #bangpypers at irc.freenode.net

The first IRC discussion for the PyCon India proposal happened in BangPyper’s IRC Channel. A large number of Pythonistas participated in the discussion and contributed invaluable ideas, suggestions and concerns during the course of the meeting. To our own surprise, the channel recorded it’s highest ever head count even before the officially announced timings. A quick summary of the topics and points raised during the meeting is as follows,

What?

The important topic of discussion was the theme for the PyCon India. People shared their views on what they wanted PyCon India to be.

  • A few people also raised concerns about using the name PyCon, as the name carries a huge value among the international community and any attempts to even make a localized version of it should stand up to the same quality.
  • The target audience for the conference was also discussed. Most people felt that the need for catering to newbies can not be neglected, but at the same time it’s should not just be a beginner level event as well. The conclusion was more on the lines of addressing the interests of already existing python programmers, let them be beginners, novices or seasoned hackers.
  • There was also a stress on giving importance to Indian speakers as this being an Indian version of the PyCon
  • The rationale behind the conference is to encourage Python and to display how PUGs help to spread Python within India (quoting Ramakrishna Reddy).
  • Baiju suggested having each day of the 3 day conference for one type of audience, the first day catering to beginners with tutorials, workshops and beginner talks; the second day filled with developer talks for audience who are already working full time with Python, and the third day being a code sprint.
  • The next main topic getting discussed was whether to have one talk after another or to have parallel talks running at same time.
  • There was also suggestions to have separate tracks for Python for web, system programming and for developing desktop applications.

When?

While it was unanimously decided to have the PyCon India during the first half of September, a majority vote went to 3rd, 4th and 5th of September leaving out the Sunday for people to get back to their real life. This now becomes the tentative dates for PyCon India, to start with looking up for venues on these days. Depending upon further developments happening on other related fronts, the date will get finalized.

Where?

Again it was unanimously decided to have it this time in Bangalore. Future PyCon(s) might happen in other cities, but the first one is surely to happen in Bangalore considering the fact that BangPypers is leading the effort, as well as concentration of organizing Pythonistas seem to be maximum in Bangalore comparatively (agreed, this is debatable on other fronts).

How?

The later half of the discussion was taken up by what are the things to be done to move forward. It was decided to have a formal CFP being made soon, as well as having an Open Review process for the submitted proposals using the software used for PyCon. Ghose B has been put responsible for getting the software in place, while Svaksha and Ramdas share the responsibility of Media and Publicity.

Other points which popped out during the discussion are,

  • Whether to have stalls? If so who all can be given a stall?
  • Whether to have delegate fees? If so, what would be the ideal fee?
  • Corporate presence during the conference

As this was the first ever discussion on the idea of having PyCon India, no conclusive decisions were taken other than few stances. Each of the above discussed topic will be subjected to further iterative discussions as things mature and progress further.

The next meet of IRC discussion is currently to happen at #bangpypers in irc.freenode.net on 10th March 2009, 8.230 PM IST. If you want to participate in the discussions, please be there. We are open to all kinds of ideas, suggestions, concerns and criticisms. Please feel free to poke us at #bangpypers anytime or drop a mail to BangPypers mailing list.

Even if you are not a Pythonista, please help us by spreading the word among your friends, colleagues, your HR and your company. Some of them might be really interested at some aspect of this conference.

(Python) PyProgram #8 – Cycling Alphabets

Kushal came down with a simple looking problem with constraints that might make solving it a bit not-a-needle-into-the-banana. As usual, me and Jacob sat down trying to solve it. Rather try finding various ways of solving it. The problem is, given one character within the range a-z or A-Z (not as a list, but from string.letters) we have to find the next character in the alphabetical order. When ‘z’ or ‘Z’ is encountered, the next alphabet returned should be ‘a’ or ‘A’ respectively. The constraint is that if or while conditions and for loops should not be used. And more importantly, the main solution should be of a single line. Though Kushal had a more mathematical solution, this is what me and Jacob managed to cook up as a more logical solution (note the ‘and’ and ‘or’ 😉 ),

import string

def thenext(theletter):
    return ((string.letters.find(theletter)+1) %26) and (string.letters[string.letters.find(theletter)\
+1]) or (string.letters[string.letters.find(theletter)-25])

print "for 'a' i get: "+thenext('a')
print "for 'g' i get: "+thenext('g')
print "for 'z' i get: "+thenext('z')
print "for 'A' i get: "+thenext('A')
print "for 'H' i get: "+thenext('H')
print "for 'Z' i get: "+thenext('Z')

The solution looks like..

for 'a' i get: b
for 'g' i get: h
for 'z' i get: a
for 'A' i get: B
for 'H' i get: I
for 'Z' i get: A

(Python) PyProgram #7 – Time Object Diffs

I had two time objects and needed to find the difference of time between them. Upon Googling, querying in #python and checking the documentation, found that there is not built-in function available for this. Though there were some cookbook recipes, I wanted to write my own solution to find the difference between two datetime.time objects. Though datetime.timedelta was for time difference requirements it only has a days, seconds and microseconds property while I need hour, minute and seconds. Thus, I wrote my timediff method which accepts two time objects btime and stime where btime is a bigger time than stime (b for big and s for small 😉 ), and it returns a datetime.time object for the difference time. (Why I need to have time objects? I use storm ORM 😉 )

def timediff(btime, stime):

    """Difference between two datetime.time objects

    Accepts two datetime.time objects where btime > stime

    Returns a datetime.time object of the difference in time of

    the two datetime objects.

    """

    btdelta = timedelta(hours=btime.hour, minutes=btime.minute, seconds=btime.second)

    stdelta = timedelta(hours=stime.hour, minutes=stime.minute, seconds=stime.second)

    tdiff = btdelta - stdelta

    tdiffsec = tdiff.seconds

    if tdiffsec < 60 and tdiffsec > 0:

        return time(0, 0, int(tdiffsec))

    elif tdiffsec < 3600 and tdiffsec > 0:

        tdiffsplit = str(tdiffsec/60.0).split('.')

        tdiffmin = int(tdiffsplit[0])

        tdiffsec = float("0."+tdiffsplit[1])*60

        return time(0, int(tdiffmin), int(tdiffsec))

    elif tdiffsec > 0:

        tdiffhourmin = str(tdiffsec/3600.0).split('.')

        tdiffhour = int(tdiffhourmin[0])

        tdiffminsec = str(float("0."+tdiffhourmin[1])*60).split('.')

        tdiffmin = int(tdiffminsec[0])

        tdiffsec = float("0."+tdiffminsec[1])*60

        return time(tdiffhour, tdiffmin, int(tdiffsec))

    else:

        return time(0, 0, 0)

(Python) PyProgram #6 – Finding weeks of a month

My colleague had a problem, he needed to separate the dates in a month according to weeks. That is, given a month, he has to find the dates in 1st week, dates in 2nd week and so on. This is need to query and collect a weeks data for a given month. He was trying to write his own solution which we Python guys around thought was a bit non-straight forward. My other colleague Jacob sat and wrote a small Py script to order the dates per week of a given month,

from datetime import datetime, timedelta

current_date = datetime.now() year, month = current_date.timetuple()[:2]

first_day_of_month = datetime(year, month, 1)

if month == 12:

    first_day_of_next_month = datetime(year+1, 1, 1)

else:

    first_day_of_next_month = datetime(year, month+1, 1)

#Subtracting 1 day

last_day_of_month = first_day_of_next_month - timedelta(1)

#First and Last days of the month

print first_day_of_month, last_day_of_month

#Computing start and end week days

first_week_day = first_day_of_month.weekday()+1

date_range = [0]*first_week_day + range(first_day_of_month.day,

last_day_of_month.day+1)

month = []

while date_range:

    if len(date_range) >= 7:

        week = date_range[:7]

        date_range = date_range[7:]

    else:

        week = date_range

        date_range = None

     month.append(week)

for week in month:

    print week

for week in month:

    start_week, end_week = min(week), max(week)

    if start_week==0:

        start_week = 1

    print start_week, end_week

Python BoF at foss.in

I was enquiring Baiju about the Python Collective at the Bar Camp Bangalore 5, which is scheduled for this weekend, as I hadn’t seen any discussion about it in the BangPypers list. This is when Baiju asked me about having a BoF during foss.in, which I readily seconded and as per his advice, start the discussion in BangPypers list for the same. And thats why this post comes out.

We plan to have a “Python BoF” during foss.in 2007, organized by BangPypers (the Bangalore Python User Group). The discussions will happen in the BangPypers Mailing List to decide the day and time, after which I will update the tentative date and time here, as well announce it in both BangPypers and foss.in mailing lists. Hope to see a lot of Pythonians at the BoF and interesting discussions happen 🙂

(Python) ipython

When I was just peeping into the discussions at #python, I saw a few talking about ipython. On first look, I thought it to be Iron Python stuff but was wrong. It is an (another?) enhanced Python Shell or what we otherwise call as Interactive Python Mode. The good thing with these stuffs is you can just download and try them, not much a paining process to get them working. Hence I went for it.

Features

  • Dynamic Object Introspection : We can access docstrings, function definition prototypes, source codes of modules, source files and a lot more dynamically.

For example, after importing `os` module, typing os.path?? or os.path? gives complete source code and description of the os module respectively. Similarly `%pdoc object`gives us the object’s doctstring information.

  • Local namespace completion with TAB press.
  • Numbered input/output prompts.

In [1]: print "Hello World!"
Hello World!

In [2]: (1+2)*3
Out[2]: 9

  • User-extensible`magic` commands (type %magic for information).
  • System shell access with ! prefix.

!ls will issue the `ls` command in the system shell and print its output.

  • File system navigation with %cd command.
  • Verbose and colored exception traceback.
  • Auto-parenthesis.

>>> callable_ob arg1, arg2, arg3
and the input will be translated to this:
--> callable_ob(arg1, arg2, arg3)

  • Auto-quoting.

>>> ,my_function a b c # becomes my_function("a","b","c")
>>> ;my_function a b c # becomes my_function("a b c")

  • Embeddable within other python code/modules.

Installation

I always prefer the `svn checkout` way of getting the source code. We can get to know more about ipython at its home site. We can also get pythonreadline from the same site, which helps us to have features like color, tab, completion, etc. (I read somewhere that it is not needed for ipython as it implicitly has pyreadline). The following are the steps to install ipython from the svn repos as a local copy,

  1. We can get the source code by doing an svn checkout,
  2. svn co http://ipython.scipy.org/svn/ipython/ipython/trunk ipython

  3. We need to get into the checked out source directory and run the following command
  4. python setup.py install

  5. The –home option can be used to specify a directory to install the ipython, else it will install in the default python directories.
  6. python setup.py install --home /home/myuser/python/ipython

  7. If we are using –home option, then we need to add the following line into our.bashrc. Else we need to export the PYTHONPATH variable every time adding the path of our ipython/lib/python installation to it.
  8. export PYTHONPATH=/home/myuser/python/ipython/lib/python

  9. We can run ipython by executing ipython/bin/ipython from the shell (or create a link pointing to this file).

The complete documentation can be obtained as pdf as well as viewed as HTML.