Tag Archives | Python

State of the Computer Book Market, Part 4 – The Languages – OReilly Radar

Over at O’Reilly, Mike Hendrickson posts State of the Computer Book Market, Part 4 – The Languages – OReilly Radar. Bear in mind in the world of lies, damned lies and statistics, these are statistics. Like measurements of job posting vs. languages, or web pages vs. languages, these aren’t an indication of what languages are in use out there, or what languages are suitable for use. This is just a measurement of what book titles sold the most, grouped roughly by language. If the best book on your favorite language is years old, it’s probably shown as small here. If a bunch of crappy books got published on the language-of-the-week, and the authors and publishers did a good job of getting a buzz going, it’s probably scoring high. Don’t use this to decide whether to use vi or emacs, tabs or spaces.

But it’s interesting data.

Notes from PySIG, 29-Nov-2007: Django in the real world

Fourteen people managed to find their way to the Amoskeag Business Incubator (it’s on SOUTH Commercial Street, contrary to the directions on the ABI site) for the November meeting, one week later than the usual fourth Thursday of the month, of the Python Special Interest Group.

A number of new attendees arrived this month. We pointed out that the mailing list for the group can be found on the DLSLUG and GNHLUG sites, look for “mailing list” and that there was an announcement as well as a discuss list for the group. We pointed out the main calendar at GNHLUG.org as well and talked about other resources.

Several members were new to the area or had come up from Cambridge, MA (our fair city) for the SIG meeting. They pointed out the Cambridge Python Group, who usually posts meeting announcements on Meetup.com, which boasts 103 members on their list! We discussed the ideas for mutual cooperation, and will be glad to cross-post their announcements to the PySIG -announce list.

Kent S. Johnson was the main presenter, and showed us how Django is used to host the http://www.blogcosm.com site. Without going into details on the business aspects of the site, Kent was able to give us a tour of several of the pages, talk about the RESTful URL formats, the model-view-controller model that’s used, demonstrate some of the code used to describe a model and the actions that can be taken on it, and show us some of the templating language that generates the HTML. The built-in administrative functionality, creating simple CRUD pages based on the model descriptions, was an impressive Django feature.

An excellent meeting, with lots of code and lots of ideas. Thanks to Kent for the main presentation, to our Cambridge brethren for making the long trip, to Bill Sconce for arranging, announcing and MC’ing the meeting, and to the Amoskeag Business Incubator for providing the great venue. Hope to see you all again at next month’s meeting, held on the 27th of December, likely just an informal chat due to the proximity with the holiday.

PySIG notes, 25-Oct-2007, Kent Johnson and Beautiful Soup sprint

Thirteen people elected to skip watching the second game of the World Series (Go Sox!) to attend the October meeting of the Python Special Interest Group (PySIG), held as usual at the Amoskeag Business Incubator in Manchester, New Hampshire, on the fourth Thursday of the month, 7 PM until… well, 10 PM last night!

The usual slew of announcements was made: the PySIG won’t meet on the usual night due to the Thanksgiving holiday. A meeting might happen the week after, since there are five Thursdays. Stay tuned for the official announcement. Other affiliated GNHLUG meetings are posted to http://www.gnhlug.org and all are welcome.

I had proposed a programming challenge to PySIG: following recent discussions on the GNHLUG mailing lists about attendance at meetings, Jim Kuzdrall had suggested we more closely analyze the attendance data that’s been posted to the GNHLUG wiki [1] for the past two years or so. The data is accessible from there, but the HTML format is not too easy to manipulate into an analyze-able format.

Enter BeautifulSoup. BS is a utility written in Python that parses HTML, with a lot of toleration for somewhat malformed HTML, and produces a parsed tree that can be traversed or queried or parsed into its various elements. Kent S Johnson continued his great Kent’s Korner series with a presentation on the basics of using BeautifulSoup. Kent noted that the documentation on BS is remarkably good, with illustrative examples and exhaustive discussions. BS is in its third major version and continues to be supported by its original author.

After Kent’s Korner, Bill Sconce took the driver’s seat, set up BS on his machine and we began with the kernel of source Kent had supplied to parse the source. The group participated, suggested, yelled at typos, experimented, threw out code, started over, changed the angle of attack, and successfully produced code that not only parsed the existing page, but generated a comma-separated-value file with proper escaping, thanks to the csv module. Along the way, we discussed issued of character conversion (since BS uses the aptly-named UnicodeDammit module and csv wants ASCII), escaping issues, coding styles, and more.

At the end of the presentation, Kent got the projector again to show a somewhat different tack he had used to parse the HTML, with an emphasis on writing small functions to clean each column of the idiosyncracies found in the data (a “Saturday” in the date field, a date field a two-day event, approximated attendance ~24 and so forth) and generate some results: which groups had the highest attendance for the year? No one was surprised that Nashua/MerriLUG was #1, but who knew that PySIG was #2? Woo-hoo! We noted that RubySIG was last, but there’s a good sampling problem: they had just started up early in the year, and a couple attendance figures were missing.

To follow up from the meeting, we intended to merge Kent’s improvements into the group’s code and generate some CSV files that we can make available for download from the GNHLUG wiki for all to analyze, graph, visualize and study.

Thanks to Kent for preparing his Beautiful Soup presentation, to Bill Sconce and Alex Hewitt for arranging the meeting, to Bill again for having the patience to type while twelve people tsk’d at him, to the Amoskeag Business Incubator for providing the fine facilities, and to all for attending and vigorously participating in the meeting!

[1] which actually breaks down to:
http://wiki.gnhlug.org/twiki2/bin/view/Www/PastEvents2007,
http://wiki.gnhlug.org/twiki2/bin/view/Www/PastEvents2006, and
http://wiki.gnhlug.org/twiki2/bin/view/Www/PastEvents2005

Adding a “skin=print.pattern” eliminates some of the “chrome”
surrounding the content.

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.