Programming Blog

Programming related articles.

Advanced json manipulation with python

10 April 2012

Python provides really simple api for json manipulation. Here is some code that does basic json to python conversation...


Convert python dict to xml

8 December 2011

Among all those terrible technologies, I hate the DOM API most. It accomplishes simple tasks with most complicated way possible. So Instead of manipulating XML with DOM API I wrote a simple python dict to XML converter which converts dictionary structures to python minidom object or xml string.


How to convert python tuple to dict

6 April 2011

Sometimes you might need to convert tuple (or list) to dict object to make it more readable. After all l['product_id'] is more readable than l[4]...


Django ORM performance tips - part 2

5 April 2011

This is the second part of the two-part series. First part can be found here. Here are some more tips that every django developer should know in order to write faster apps....


Pretty printing JSON output in terminal

9 March 2011

If you need to pretty print the json output of a terminal command (so you can inspect it more easily), you can use python's json module. I usually use it to pretty print the output of curl command. Here is an example

    :::bash
    curl http://somesite.com/my/json/ | python -m json.tool

This utility can also be used to pretty print json files like following

    :::bash
    python -m json.tool minified.json > prettyprint.json


Django ORM performance tips - part 1

8 March 2011

This blog post will be split into two part. After I finish part two, I will add a link at the bottom of this one. For both parts I will use a sample project with sqlite3 database. models.py file for sample application is here...


- Follow yilmaz_huseyin on Twitter