How I made a simple Business Model Canvas for geekar

The power of simple python scripting is one of the themes of this blog, and now I can show a great practical example.

I needed to create something that looks like this:

geekar Business Model Canvas
geekar Business Model Canvas (click for webpage)

This is a simple HTML table with some CSS. But trying to write it in HTML would result in a lot of copy-pasting of stuff that looks like this:


<td colspan="2" rowspan="2">
<h3>Value Propositions</h3>
<div class="postit "><i>Awesome</i> AR Geek Shop</div>
<div class="postit ">Infinite shelf space for long-tail products</div>
<div class="postit cl ">Products connected to info online</div>
<div class="postit ">Products connected to geeks in other stores</div>
<div class="postit cl ">Sense of community</div>
<div class="postit ">Pleasure of random surprises</div>
<div class="postit cl ">Easily to setup mobile shop</div>
<div class="postit ">Platform for interesting promotions</div>
</td>

That’s a lot of boring and error prone copy-pasting. And I’ll need to create lots of these in the coming months.

OK, so I need to write a script that will turn this:


CANVAS = {
"customers": [x + " Fans" for x in ["Comics", "RPG", " MTG", "Anime"]] + [" Gamers"],
"values": [
"<i>Awesome</i> AR Geek Shop",
"Infinite shelf space for long-tail products",
" Products connected to info online",
"Products connected to geeks in other stores",
" Sense of community",
"Pleasure of random surprises",
" Easily to setup mobile shop",
"Platform for interesting promotions",
],
"channels": ["Conventions as marketing", "Retail (our shops)", " Online", "Geek events we host"],
"relationships": ["Physical", "Online Community", " Promotions", "Geek Events"],
"revenues": ["Asset sales"],
"resources": ["Shops", "Registered users", " Merchandise", "Promotions"],
"activities": ["Sales", "Marketing", " Hosting events"],
"partners": [
"WotC?",
" Marvel?",
" DC?",
" TOKYOPOP ?"
],
"costs": ["One time: Development", "Constant: Rent", "Initial Merchandise", "Employee salary"],
}

Into the correct HTML.

It’s actually really easy:


import sys
HTML = """<?doctype html>
<html>
<head>
<style>
body {
background-color: gray;
}
// …
.cl {
clear: left;
}
</style>
</head>
<body>
<h1>The Business Model Canvas</h1>
<h2>Designed for: %%s</h2>
<h2>Designed by: Aur Saraf</h2>
<table>
<tr>
<td rowspan="2">
<h3>Key Partners</h3>
%(partners)s
</td>
<td>
<h3>Key Activities</h3>
%(activities)s
</td>
<td colspan="2" rowspan="2">
<h3>Value Propositions</h3>
%(values)s
</td>
</tr>
<!– … –!>
</table>
<!– … –!>
</body>
</html>
"""
POSTIT = '<div class="postit %(classes)s">%(content)s</div>'
CANVAS_CODE = """CANVAS = {
"customers": [],
"values": [],
"channels": [],
"relationships": [],
"revenues": [],
"resources": [],
"activities": [],
"partners": [],
"costs": [],
}
"""
def to_postit(caption):
classes = ""
if caption.startswith(" "):
classes = "cl "
caption = caption[1:]
return POSTIT % {"classes": classes, "content": caption}
def write(name, canvas, f):
canvas = dict((k, "\n".join(map(to_postit, v))) for k, v in canvas.iteritems())
html = HTML % canvas % name
f.write(html)
def main():
if len(sys.argv) == 3 and sys.argv[1] == "-new":
with file(sys.argv[2] + ".py", "wb") as f:
f.write(CANVAS_CODE)
return 0
elif len(sys.argv) != 2:
print "usage: canvas.py name"
return 1
name = sys.argv[1]
module = __import__(name)
with file(name + ".html", "wb") as f:
write(name, module.CANVAS, f)
return 0
if __name__ == '__main__':
sys.exit(main())

view raw

canvas.py

hosted with ❤ by GitHub


$ python canvas.py -new geekar
$ emacs geekar.py
$ python canvas.py geekar

view raw

usage example

hosted with ❤ by GitHub

It’s a small command-line tool that knows how to create an empty .py file for a canvas with the correct template, and knows how to read a .py file as a python file (since this is for self-use only I’m fine with no security at all, otherwise reading it as a python file would be very unwise) and do some preprocessing and some search-and-replacin’ to get the right thing into an HTML template.

I needed to be able to control how many notes to have in a row, so I added parsing of a space at the beginning of a note caption to mean “newline before this”. I needed to write many similar notes for “customer segments” – so I used the fact that the canvas definition file is in python to just write some python that generates it:

“customers”: [x + ” Fans” for x in [“Comics”, “RPG”, ” MTG”, “Anime”]] + [” Gamers”],

And that’s all there is to it. One of my students could write this in ten minutes. From now on, something that I will be doing every day will take a few minutes less.

Is It Worth the Time?

The whole code can be found here: https://github.com/SonOfLilit/quickbmc and the complete result here: https://github.com/SonOfLilit/quickbmc/tree/gh-pages.

Business Model Exercise #1: geekar

I started exercising my idea muscles a few days ago.

Every day I think of 10 startup ideas and develop one into a business model. Some will be published here.

Lets begin with the first example – geekar, an Augmented Reality-enhanced retail, in the most early-adopter industry I know: geeks. geekar will sell comic books, tabletop roleplaying sourcebooks, board games, trading card games, manga, anime, computer games and so on.

Continue reading

I — I don’t even see the code. All I see is blonde, brunette, redhead…

I was holding up on posting until I can say more about PythonForAll (it’s not that I didn’t get out of the building, just that it’s becoming a bit more serious so I can’t publish things before they are final) but I just have to write about this:

matrix-code

For a long time I’ve wanted to code a screensaver showing matrix code, just like the gajillion clones you can already find on the internet, but instead of showing random characters, this one would capture (“sniff”) network packets and show them in encoded form.

The theory is that if you watch this long enough, you’ll begin to “see through the code” – at first, you’ll learn to decode the characters into numbers, and at more advanced stages you’ll learn to parse the network protocols intuitively. I have many reasons to believe this:

  • I’ve seen people learning languages and musical instruments (and experienced it myself)
  • I’ve heard that one of the Samba developers can decode raw NBNS packets in his head (one of the most horrible encodings I’ve seen, see here 1.3.1)
  • I knew someone who could synchronize a dial-up modem with his voice
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don’t do bad things, we have lawyers.

 

Announcing Wirematrix

Today I saw this HN thread and was reminded of this idea. I decided that the time had come. A night of work later, an alpha version exists and the main feature works well:

If you'll look closely, you'll see that some patterns can be noticed immediately even from one static screenshot
If you’ll look closely, you’ll see that some patterns can be noticed immediately even from one static screenshot

You can get it on github. If you are not experienced with compiling linux software, I advise you to wait for a more user friendly release. Drop a comment saying you’re interested, it will motivate me to create one.

There’s work to do on friendliness of installation and on shininess of visualization. Other than that it’s complete. Python and Cairo rock!