-
posts
-
Kubernetes Health Checks in Django
In a previous post I wrote about Kubernetes health checks. Since I’m a Python developer and a fan, I went about implementing it in Django. Health checks are a great way to help Kubernetes help your app to have high availability, and that include...
-
A Quick Look at the Kubernetes Python Client
For those of you that don’t know there is a new Python API client in the kubernetes-incubator project: client-python. There has been some high quality Python clients like pykube, but client-python can serve as the official Python client.
The Stru...
-
Testing Django Views Without Using the Test Client
The normal way to test Django views is via the test client. The test client fakes being a wsgi server and actually makes an HTTP request through all of Django’s request routing machinery. There are a number of reasons why this isn’t an ideal appro...
-
Pickling Objects with Cached Properties
Python descriptors allow you to create properties on python objects
that are the result of executing some code. One of the simplest ways of doing
that is using the @property decorator. Here, accessing the myprop will
call the method and return the...
-
New Year’s Python Meme 2014
Since everyone else was doing it I thought I’d write one up too.
What’s the coolest Python application, framework or library you discovered this year?
Luigi: A data processing pipeline framework written by some folks at Spotify. I gave a talk...
-
App Engine Pull Queues and kombu
App Engine provides a pull queue API
for accessing, leasing, and processing tasks outside of App Engine. You might
do this to perform long running tasks that aren’t suited to App Engine’s
infrastructure. Or you might want to use a library or syste...
-
PyCon APAC 2013
PyCon APAC 2013 is over! I want to thank
everyone who helped make the conference a great success. Staff,
speakers, attendees alike all contributed to making PyCon APAC 2013 the
best PyCon in Japan ever.
</assets/images/710/2013-09-14_08.11.0...
-
Google App Engine 1.7.7 pre-release
Note
**Update:** App Engine 1.7.7 final has been released and is available
here: <https://developers.google.com/appengine/downloads>
The App Engine 1.7.7 pre-release SDKs were
released
about a week ago and I finally got around to...
-
Administer WordPress using Django's Admin
I recently came across one feature of Django that seemed pretty useful
for one off projects and customizations and was startled because it’s
one of Django’s least mentioned features. In fact, I’ve been using
Django at work for over 5 years now and...
-
Mixins and Python
Python supports a simple type of multiple inheritance which allows the
creation of Mixins. Mixins are a sort of class that is used to “mix in”
extra properties and methods into a class. This allows you to create
classes in a compositional style.
...
-
A Japanese Python Community Who's Who
There is a small but growing Python community in Japan. Many people, even some
of those Python enthusiasts who living in Japan, are unaware of this and don’t
know who any of these people are. There are a lot of reasons for this but the
number one ...
-
Django's contrib.auth and django-newauth
Recently there have been a lot of conversations on the Django mailing
list about fixing the auth module. Here are some of the recent mailing
list threads:
authentication by
email
auth.User refactor:
reboot
auth.User: The abstract base clas...
-
Python Sets
I had an application with two lists of unique items that I wanted to
take the intersection of. I had figured that using a python set would be
faster but I didn’t realize that it would be faster than the simple list
comprehension by this much.
~$ ...
-
Pycon JP 2011 was Awesome!
_
On Saturday we held our first Python JP 2011. We had approximately 230
people show up which I think is great for a first time Python conference
in Japan. I want to thank all of the members of the planning committee,
staff, and attendees for suc...
-
Pycon JP 2011
_
The Python Programming Language community in Japan will be having our
first Pycon JP on August 27th at the Advanced Institute of Industrial
Technology (産業技術大学院大学) in Tokyo’s Shinagawa Seaside.
Pycon JP started in the aftermath of Pycon APAC 20...
-
Kay 1.1 Released!
The Kay team just just released Kay 1.1! I want to thank Takashi
Matsuo, Nickolas Daskalou, Tasuku Suenaga, and Yosuke Suzuki for their
hard work on this release.
Kay is a web framework made specifically for Google App Engine. The
basic design of...
-
An introduction to the Tipfy Framework for Appengine
(This post is the English translation of the Dec. 24th edition of the
Python Web Framework Advent
Calendar 2010. Other posts can be found
at: http://atnd.org/events/10465 though they will be in Japanese)
I usually use the kay
framework for Appeng...
-
Google Appengine 1.4.0 Released!!
Google Appengine 1.4.0 was just
released and has lots of interesting new features. Channel API, “Always
On” (reserved instances), Improvements to background processing, Warm up
requests, and Metadata queries just to name the big ones.
Channel API...
-
New Google Appengine API Expert
Yesterday I became the new Google Appengine API
Expert (Python)
for the Japan region. Google Experts are the equivalent for Google API
Gurus as they are called in the ‘States. I will be helping out other
developers in Japan to learn about and ...
-
bpssl - The Django SSL Support Application
The other day I released bpssl which is a Django application that helps
you support HTTPS on your website. The main functionality is performing
redirection for HTTPS only URLs and views. For instance, if a request
for your login view ‘/login’ is r...
-
Cron only decorator for appengine
For a recent project I recently I have been using appengine’s cron
feature to aggregate data and perform maintenance tasks. However, since
cron is a simple web request, if a user accesses that url then the cron
job will run. In order to prevent no...
-
Dynamically Adding a Method to Classes or Class Instances in Python
In Python you sometimes want to dynamically add methods to classes or
class instances (objects). In Python code, the most obvious way to
accomplish this might be something like the following but it has one
caveat,
class MyObj(object):
def __i...
-
Key Value Storage Systems ... and Beyond ... with Python
Google docs wouldn't let me share the presentation publicly with people outside our company's domain and it gave me an error when I tried to download it as a Powerpoint file or PDF so I was forced to recreate my presentation locally. Anyway, I pla...
-
python-openvcdiff and Cython
I started a project today to implement an interface for the
open-vcdiff using
Cython. I’m not a C++ master and the Python C
libraries are pretty new to me but I managed to expose and implement a
few methods of the VCDiffEncoder class. The hardest ...
-
Parsing email with attachments in python
Recently I needed to be able to parse out attachments and body from
multipart emails and use the resulting data to post to a service. So I
wrote the code below to parse out text and html portions of the email
and also parse out attachments.
The c...
-
Transactions on Appengine
The way to store data on Appengine is with
Google’s
BigTable Datastore
which has support for transactions. However, the transactions are quite limited
in that,
You can only execute callables inside transactions. Which means you
basically ...
-
Werkzeug and reverse urls
I wanted to impove a Google Appengine application that a friend of mine created (ほぼ汎用イベント管理ツール(jp)) and noticed that he was redirecting directly to urls. He is using Werkzeug to handle url routing so I wondered if there was a method for generating...
-
QueryDict and update()
Yesterday I ran into an interesting quirk with Django's QueryDict object and the normal dictionary update() method. Normally the update method will allow you to merge two dictionary or dictionary like objects but because the QueryDict internally h...
-
Field/column Queries in Django
One of the neat things making it's way into Django 1.1 is F object queries. The F object is kind of like the Q object as it can be used it queries but it represents a database field on the right hand side of an equality/inequality.
For the exampl...
-
Python date range iterator
I couldn’t find something that gave me quite what I wanted so I created
a simple Python generator to give me the dates
between two datetimes.
def datetimeIterator(from_date, to_date):
from datetime import timedelta
if from_date > to_da...
-
Introduction to Algorithms
Today my copy of Introduction to Algorithms came in the mail (a gift from the family). I've decided, mostly inspired by Peteris Krumins to revisit classic algorithms as it's been a while since I've taken a look at them.
I have decided to als...
-
Django Sitemap Framework
Using the Django sitemap framework is so easy it's almost no work at all. Just make a sitemap object and add it to the sitemap in urls.py. The sitemap framework calls items() in your Sitemap to get the list of objects to put in the sitemap and the...
-
Django admin inline forms
For my new project dlife (Update: Now django-lifestream), I went about implementing a simple comments interface that would allow users to make comments on imported feed items. I wanted to support this in the admin in the typical manner such that w...
-
Feedparser and Django
Over the weekend at Python Onsen I worked on a lifestream web application using Django and feedparser. I was really impressed with how simple feedparser is to use and how easy it is to get unified results from atom or rss feeds. You simply import ...
-
Python Onsen Oct. 2008
Last weekend I went to my second Python Onsen[jp] organized by Nakai-san(id:voluntas). I talked about Python Onsen in my first blog post here. Python Onsen is a 3 day event (Fri, Sat, Sun) but as before I only participated on Saturday and Sunday. ...
-
jsonschema 0.2 alpha
I just released a new version of jsonschema 0.2 alpha over at http://code.google.com/p/jsonschema
The source can be downloaded here: jsonschema-0.2a.tar.gz The documentation can be found here: jsonschema (version 0.2a) documentation
The new releas...
-
jsonschema mentioned on json.com
Kris Zyp (the author of the JSONSchema proposal) mentioned jsonschema on his blog at json.com. Thanks Kris!!
-
JSON Schema Validator 0.1a for Python
I just released the first version for a project that I've been working on since the Python Onsen. It's a validator for JSON Schema written in Python. It's based on the JSON Schema Proposal Second Draft.
The source can be downloaded here: jsonsche...
-
Django
I was thinking about using Django for one of my projects on GAE because it seems like a popular project and somewhat easy to use, but I'm not quite understanding yet why it's better to have helper functions rather than controller/handler classes l...
-
Protocol Buffers
A few days ago Protocol Buffers was released by Google as an open source project. Protocol Buffers is a way to generate code for objects that can be serialized to and de-serialized from the protocol buffers binary format. An implementation of the ...
-
Python Onsen
This weekend I went to the Python Onsen (Japanese) organized by
Voluntas. Python Onsen is an event
where people who like or are interested in python get together at a
Japanese Ryokan
Onsen and program/mingle/study
together. The event started Fri...
-
Google Developer Day 2008
Google Developer Day Japan
2008 is
being held on June 10th at Google’s offices in Shibuya and I’ve registered to
attend this year. There were a number of sessions that people could take part
in but I decided to register for a
Google appengine hack...