Python Helps Usher in Bio 2.0

Bio 2.0 is coming, with protein synthesis on-demand. I thought it was in the far future, but then I found this great hands-on article explaining how to do it, right now!

Transcriptic Workcell

That article blew my mind two ways:

  1. You can literally type a sequence of base pairs (e.g., ATCGATTGAGCTCTAGCG) into a text file and a lab can create the protein you specified.

  2. You can completely automate testing. The above article shows how to write a Python program to say exactly how you want your biology experiment conducted. Your experiment can have conditions. The way the above works is ...

more ...

How to Integrate AdWords with HipChat

Here I'll show an easy way (if you're a developer) to get daily AdWords reports into a HipChat room. We'll use Google App Engine as the integration glue. An alternate approach I'm not using here is to define your own Zapier integration. Before we start, here's an overview of the architecture:

HipChat-Integration

To summarize, the integration will:

  1. In AdWords: generate a daily report and email it.
  2. In HipChat: a dedicated room will receive and display message.
  3. In App Engine: receive email and send HipChat message to HipChat room.

1. AdWords Integration

We will write a small ...

more ...

Static Blogs Are Awesome

Static blogs hosted on cloud infrastructure are awesome when compared to older hosting solutions like Wordpress and Typepad. The benefits are:

  • cheap
  • fast delivery of content
  • complete control to customize your blog
  • you're not dependent on an external company

Over a decade ago, we gambled on Typepad as our blog host. However, the sands of time have seen Typepad sold off to some international holding company, and now it seems to be in stand-by legacy mode. We evaluated a few static blog replacements:

We're a Python ...

more ...

How to Integrate App Engine app with Google Drive

Let's assume you're writing a Google App Engine app in Python.  And you want to use the Google File Picker API to select files from the user's Google Drive, and also the Google Drive API to download the selected files. You can write your server-side appengine app in Python, and then use Javascript for the file picker and file download.  It's not super hard, but I couldn't find it completely documented anywhere.  I only found one description of the tough issues .

At a high-level, your architecture is:

  • Server: App Engine app in Python, which includes ...
more ...

There Are Only Two Ways to Enforce Unique Constraints in Google App Engine

Well, it sucks but it's true. There's a bunch of noise on the Internet about how to do unique constraints in Google App Engine, but it seems like these are the only two safe ways. The thing to remember is, the only uniqueness that GAE will guarantee is on key names.

Approach #1: Make the unique field be the key name

As long as you promise to yourself that you'll never need to change the value, then you should make the unique field be the "key name" in the table. Then you can call db.Model.get_or_insert ...

more ...

Python on Android -- Easy as Pie

Here's what I did to get Python running on my HTC Incredible:

Step 1:  Install a barcode scanner, so that it's easier to install custom apps:  Install ZXing app

Step 2:  Install the SL4A application (Scripting Layer for Android) by going to the SL4A project home page and running the previously installed "Barcode Scanner" app (the title on the icon of the ZXing app) to scan the SL4A's barcode (or just click the link if you're reading this on your Android). This downloads a .apk file which you then run to install this app directly onto ...

more ...

Announcing New Consulting Offerings

We've actually been doing consulting for a while, and now we're formalizing it into two product areas:

  • PyGuys - Python and open source based solution consulting
  • PyCOE - Python Center of Excellence, we help you set up a process or organization inside your company to encourage adoption of Python
more ...

Summary of Python Web Frameworks, Beginning of 2008

Let me summarize our recommendations for Python web frameworks:

  • Pylons: for database-driven applications
  • Plone (built on Zope3): for CMS (content management systems)
  • Twisted: for multiple/custom network protocols or extremely high volume

Overall, the Python web community is seeing a lot of active
development and evolution in solutions. Whereas the Ruby community has
one go-to web framework (Ruby on Rails), the Python community has a
plethora of choices. Luckily, a Python standard was created, PEP 333aka WSGI
(pronounced "whiskey" but stands for Web Server Gateway Interface),
which provides a standard component architecture for Python web
servers. All of the ...

more ...