I just released pygooglechart 0.2.1. It has several bug fixes and minor additions, but the major change is that it now supports QR codes. You can quite easily create a QR code with pygooglechart as you can see below.
from pygooglechart import QRChart
# Create a 125x125 QR code chart
chart = QRChart(125, 125)
# Add the text
# "Level H" error correction with a 0 pixel margin
This will download a png from the URL:
The image downloaded looks like this:
QR codes are new to me. I’ve only seen a QR code on a bus stop advertisement once in Sydney but I’m sure more will pop up.
Last week I quietly released pycallgraph 0.5.1 with some outstanding bugs fixed and preparation for it to be a Debian package.
I decided to make a CAPTCHA plugin for Trac called TracRecaptchaPlugin, to stop spammers using the ticket system. There is an existing Trac plugin to fight spammers, but it still lets through many automated spammers.
The plugin uses the reCAPTCHA service and is serving me well so far. Here’s how it looks within the template:
This is my first publicly released Trac plugin so I’m unsure how it’ll perform out there, so feedback is welcome.
I released pygooglechart 0.2.0 this afternoon after several months of patches coming in to add features and fix bugs. The main addition to pygooglechart is automatic data scaling, which is turned on by default. You can also specify the scale range manually:
chart = SimpleLineChart(width, height, x_range=(0, 100), y_range=(0, 100))
Other features are the new API chart types and options. There are 3 new chart types: Map, Google-o-Meter and Radar. Here is an example of using the Map chart type:
import pygooglechart as gc
chart = gc.MapChart(440, 220)
chart.set_colours(('AAAAAA', '30A030', 'A0C030'))
chart.set_codes(['AU', 'US', 'CA', 'BR', 'NZ'])
chart.add_data([1, 0.5, 0.7, 0.3, 0.1])
Produces the URL:
And the image:
The Google-o-meter has a funny name. Here is an example of its usage:
import pygooglechart as gc
chart = gc.GoogleOMeterChart(440, 220, y_range=(0, 10))
It produces this URL:
And the image:
Well, have fun. Please tweet me for any bugs, patches or feature requests you have.
Just a quick update. I have recently made some Python releases.
I find readability very important when reading data. It saves time and energy. To me, Python’s pprint module is not easy to read in a lot of cases so I made my own. This is how pprint looks like at the moment:
BetterPrint is based on a lot of the source code, which looks about 10 years old. It makes more sense to me to have braces aligned by column rather than jammed together inline. BetterPrint also introduces colour to increase readability even more. As you can see from the following screen shot:
BetterPrint is compatible with Python’s pprint module, so you can simply “import betterprint” aliased as pprint like so:
import betterprint as pprint
If you have setuptools installed simply run “easy_install betterprint”, or visit the web page for more details and installation instructions.
After promising myself to do it after many months, I’ve finally written a Greasemonkey script to reformat JSON output to be easily readable by a human. I may do cool things like syntax highlighting and expandable branches in the future, if the need and/or time arises.
I’ve just released pycallgraph 0.4.0. It has several major new features including a command line interface and measuring accumulative time per function.
The 0.4.0 pycallgraph CLI supports function filtering, timing filtering, maximum stack level and a few more settings. For example, to do a simple call graph on “myfile.py”:
pycallgraph-dot.py myfile.py mygraph.png
Here’s an example that doesn’t include the class Foo and outputs to a SVG file format:
pycallgraph-dot.py –exclude=”*.Foo.*” –image-format=svg myfile.py myfile.svg
Turns out far easier than modifying your source code to create a call graph.
Here’s one of the graphs from the source code examples colours.py:
As you can see it has green and orange gradients. One end of the gradient is green because of the number of calls is high and the other is orange because the function calls are taking the longest. All that with a function that looks like this:
def orange_green(calls, total_time):
"""Make a higher total time have an orange colour and a higher number
of calls have a green colour using RGB.
return '#%02X%02X%02X' % (
0x30 + total_time * 0xc0,
0x30 + calls * 0xc0 + total_time * 0x70,
I hope it’s useful to you!
For the lack of updates, here is an update:
- Just released pycallgraph 0.3.1 which fixes a few bugs.
- This week hopefully releasing a pre-alpha of c80 which is an AJAX IRC client.
- Development of VirtuShare, a transparent peer-to-peer networking service, is still in progress.
I have released pyraknet 0.1.4! For those who don’t know… it lets you easily apply multi-player networking to your python game pretty easily. Enjoy!
Within 24 hours of releasing version 0.1.0, I’ve released 0.2.0 of pycallgraph. It’s just so fun to play with Graphviz…
I have just released pycallgraph which can create call graphs for Python programs. Quite useful for working out how Python programs work and to see if you have any problems in your program flow.
I’ve been releasing new versions of pyraknet like a mad man. pyraknet 0.1.3 has been released with the major change being a new Windows binary for Python 2.5. Other things include documentation, tests and one new method.
I have released the multiplayer network library pyraknet 0.1.2 with a few more features. I’ll be updating it with some more features soon.