Articles by Balthazar

Here is a list of all articles written by Balthazar.

28 Jun 2012

Tag: Python

Tag: Api

Communicating with RESTful APIs in Python

Written by Balthazar

REST defines a way to design an API with which you can consume its ressources using HTTP methods (GET, POST, etc) over URLs. Interacting with such an API basically comes down to sending HTTP requests.

In this article, we’ll see which python modules are available to solve this problem, and which one you should use. We’ll test all modules with this simple test case: we would like to create a new Github repository using their RESTful API.

Read more

08 Jun 2012

Tag: Python

Tag: Ai

Automation of the Tesseract training process

Written by Balthazar

Tesseract is an open-source Optical Character Recognition engine, historically developped by HP and Google, allowing you to extract text information out of images. One of the great features of tesseract is the possibility of training it on a new language, a new set of characters, or even on a particular font. The training procedure is fully described here.

This prodecure is quite long and tedious. That’s why I’ve written a standalone Python wrapper that can take care of the training process for you, in the case where you want to train tesseract on a new font, or characters. This demo is intended for Unix/Linux users.

Read more

21 May 2012

Tag: Python

Python built-in functions are awesome. Use them!

Written by Balthazar

  • Introduction

Introduction

In this article, we are going to see a couple use-case examples of some of the Python built-in functions. These functions can prove themselves extremely useful, and I think every Python coder should learn how to use them: they’re fast and well thought.

For each function, I will provide two snippets: one without any built-in function, and the equivalent “pythonic” snippet.

Read more

23 Apr 2012

Tag: Python

Tag: Internet

Crawl a website with scrapy

Written by Balthazar

  • Introduction

Introduction

In this article, we are going to see how to scrape information from a website, in particular, from all pages with a common URL pattern. We will see how to do that with Scrapy, a very powerful, and yet simple, scraping and web-crawling framework.

Read more

19 Apr 2012

Tag: Python

Embed IPython in a virtualenv

Written by Balthazar

  • About virtualenv

About virtualenv

I recently got introduced to virtualenv: a “tool to create isolated Python evironments”. It allows to have a fine grain control on the dependencies of each of your python project, and separate each project environment from the others.

Read more

11 Apr 2012

Tag: Linux

Blur images with ImageMagick

Written by Balthazar

  • Introduction

Introduction

I always forget how to precisely use ImageMagick, the documentation being so vast and operators being so numerous. This time I wanted to blur an image, testing different blurring radiuses. This is how to do it.

Read more

01 Apr 2012

Tag: Python

Chart the evolution of your CPU and GPU temperature

Written by Balthazar

  • The problem

The problem

My laptop can be hot sometimes, especially when I run great python calculations while I watch a movie, tweet with Hotot, chat with a couple of friends and send a couple of emails. (Hotot has nothing to do with this article, but I just think it’s a great twitter client).

Read more

31 Mar 2012

Tag: Python

Class inheritance syntax in Python

Written by Balthazar

I recently stumbled upon a weird error message when playing with class inheritance.

I declared a mother class, with some attributes and methods, and derived a child class from it, with some additional arguments and overridden methods.

Read more

29 Mar 2012

Tag: Internet

Why I love Twitter and I hate Facebook

Written by Balthazar

  • Who am I?

Who am I?

I’m a social guy. Really. I love staying in touch with friends from college and high school, know what they’re up to. I really easily connect with people and love meeting new faces. I’m the typical Facebook user.

Read more

29 Feb 2012

Tag: Python

Create a webcam manager using pyGTK and Gstreamer

Written by Balthazar

  • Introduction

Introduction

I recently joined the Strongsteam project for a 6 month internship. Our main goal is to provide some “artificial intelligence and data mining APIs to let you pull interesting information out of images, video and audio.” We will be doing a presentation at Pycon 2012, the 9th of March, during the Startup Row weekend.

Read more

29 Nov 2011

Tag: Linux

Some useful Linux desktop tools

Written by Balthazar

One of the reason of the awesomness of Linux is the infinite number of nice tools you can install. It thus gives you this “feel like at home” fuzzy feeling. Every time I use a friend’s computer, I can’t help but thinking “Man, it feels strange” : we’re using the same distro, but both our laptops provide different experiences.

I hereby present the tools that make me feel at home.

Read more

20 Nov 2011

Tag: Python

Create your own web-service using Python and micro web frameworks

Written by Balthazar

The idea of this post is to show you that if you want to implement a web-service, Python could be the way to go. The simplicity of the language syntaxis combined with some good micro-framework results into a powerful combination.

Read more

10 Nov 2011

Tag: Python

Optimization of the Monty Python parody code

Written by Balthazar

In this post, we’ll see how the program proposed in my previous post can be optimized in term of execution time. The code can be found the project GitHub repository. For those who haven’t read the first article but are interested in code optimization, i’d then advise you to read it first, to understand the causes of the problem.

Read more

06 Nov 2011

Tag: Python

How to randomly generate a Monty Python parody

Written by Balthazar

If you always wanted to write texts in the way of Monty Python, I have what you need ! In this post, I am going to show you mathematical techniques to analyse a text, in order to randomly generate look-alike texts.

Read more