Monday, April 19, 2010

A few useful modules

Decided that my original post was way to long, so split it...

The other thing I want to do is mention modules that I have found and which I am using, or think will be useful. This is mainly so that I don't forget about them myself when I come to actually need them, but is also part of my goal to keep you all informed of how the project is progressing - especially in the beginning when there is no real working code to show.

As stated earlier, the first thing I have done is implement a basic email interface, specifically to Yahoo! Mail. The module I am using for this is PyCascade, written by Peter Griess. It uses OAuth for authentication, and gets data in JSON format. For this, it includes the simplejson and oauth modules, but I replaced the latter with the better oauth2 module which required some modifications. Depending on how I implement other interfaces, I may end up generalising the PyCascade module, as it is a very nice interface to OAuth and JSON.

The second module I have found is not so much a module as an entire networking engine, called Twisted. It consists of a number of sub-projects covering servers and clients for everything from SSH and SFTP for file transfers through to NNTP for news, and various chat protocols. As it is event-driven, it could be used for implementing some of my information interfaces or communication links, but I will need to investigate further.

Sunday, April 18, 2010

The Plan? What Plan?

As is normally the case when I begin a personal programming project, I started coding with only a basic idea of what I was aiming for. The good news is that I can now check for unread emails and download their subjects using Python! But I really need to write down some semblance of a plan, if this is to have any chance of success (without me needing to recode half the system!).

Basically, I am going for a three-part system. One part will consist of the various interfaces to what I want to control, or get information from (email clients, RSS feeds, news sites etc.). The second part will be a two-way communication link between the system and myself. To begin with this will just be a Python console, but could (and probably will) extend to email, instant messaging, and even text messaging. Both of these parts will be designed to be as modular as possible, so extra functionality can be dropped in relatively easily.

Sandwiched in between these two parts will be the core of the system. This is what I am most uncertain of at the moment, but it will likely consist of several threads running individual functions which can share data between themselves. It will cover functions such as:
  • Processing commands
  • Retrieving and handling information
  • Cron-like scheduling (e.g. periodically checking for new emails)
  • Listening to communication links (could also remember which I last used, so could announce updates like new email on correct interface)
  • ... umm, that's all I can think of right now...

Hmm... Much of this "plan" needs expanding on, but it's a start.

Monday, April 12, 2010

The Start

So...

I've had an idea rattling around in my head for a while now, to create a natural language interface to my computer. Something similar to the speech recognition in Windows 7, so supports dictation, can open programs - generally control the computer. But I wanted it to be more flexible in terms of how I could control it, so I didn't need to follow a specific set of commands. In addition, being custom-programmed, I would be able to add other features to it like checking my emails for me.

Well that never really got going, due to natural language processing being rather tricky and me not having time to devote to it. But a few days ago, I stumbled upon Project Jarvis, a digital life assistant created by Chad Barraford. It is similar to what I had imagined I would end up with, but instead of focussing on the speech interface, he started with the functionality. While I have no need for everything that Jarvis can do, there are several features that I want to try implementing myself.

So that's it. This is the start of The Overlord. Being primarily an exercise in Python programming, it will be open-source, and any code will be released under the GPL.

Should be fun...