Canonical Voices

Posts tagged with 'python snippets'


Yesterday I announced that the new Severed Fifth website is launched on Monday, and with it will begin the second phase of the project and the build-up to the second album. For the first album I ran out of steam as I had just signed up to do The Art Of Community for O’Reilly and this sucked up all of my spare time. I don’t want to make the same mistake again.

As such, I am keen to hand over some of my projects to new maintainers who can be sure to give them the time and focus that they deserve. Today I want to share some of the next next steps I would ideally like to see to provide some food for thought, and appeal for volunteers to take the reigns in these projects:


Acire is the project I created to produce a solid library of Python Snippets to make it easier for new developers to get started with the platform. The project has been pretty popular and I am keen to see it continue to grow.

Right now Acire has a good feature-set to browse and run snippets, but I would love to see it continue to develop and include the following:

  • Dependency Checking – when running a snippet that requires a module that you don’t have installed, Acire should tell you and provide a one-click installation of the required module(s). Ed has a branch that he started, and this seems like a good start on this solution.
  • Async Documentation Checking – right now when Acire loads documentation links it stalls due to it’s non-async loading of the docs URL title. This causes significant problems if you are not connected to a network. It would be good to use GIO to solve this.
  • Better Searchability Of Snippets – I would love to see (a) a search box to do a text search across all snippets and (b) see a better taxonomy of snippets. There are two cases here: (1) I want a snippet that is part of a specific module, and (2) I want a snippet to help me with something (such as playing music). Today you can only search by category (which is mainly categorized by module name). This could be greatly improved.
  • Multiple Language Support – while I love Python, I would love Acire to be able to support multiple languages. I think the most elegant way to do this is to have a language pack for each supported language. Today you get Python content with the python-snippets package, but I would love to see c#-snippets as an example.

Would you like to take the reigns with Acire? If so, drop me an email to jono AT ubuntu DOT com.

Python Snippets

For Python Snippets I would like to grow a team of reviewers. Right now I approve all merge proposals and merge them into the branch (which is used to generate the daily PPA), but I think it makes better sense to distribute this work across a number of contributors that can communicate via a mailing list.

If you are interested in joining this team, drop me an email to jono AT ubuntu DOT com.


PyJunior was a project I wrote in a few hours while on vacation. The whole point is to make programming for kids much easier, and although simple, the program is off to a good start.

PyJunior really excites me. It holds so much potential to really introduce kids to Python and all the fun you can have with it. Some plans I have had for PyJunior include

  • Integrated Kid Friendly Docs – I have a dream for the documentation in PyJunior. You click the Help button and a window displays a list of Recipes. These are tutorial documents that outline how to do something fun such as make a calculator or a game. Each recipe not only explains how to write the code in simple kid-friendly steps, but also includes a button next to each code snippet that will paste it into the editor. I think it could be awesome to have a PyJunior Docs Team that produces these docs, and that the Recipe Browser would grab them off the Internet to save having to ship them with the app. This could really open up the world of programming for kids.
  • Sharing Programs – I includes a Share button in PyJunior that is switched off by default, but the goal was to create one-click way in which you can share a program with your friend. Kids need to be able to easily help each other with programs and this would provide a means for one kid to share his/her program with their friend who can then help them do something or fix a problem.
  • Interactive Tutorial – I would love to have written an animated interactive tutorial (like the first level of a modern game that explains how the controls work) that explains how the interface works.

Would you like to take the reigns with PyJunior? If so, drop me an email to jono AT ubuntu DOT com.

Moving On

If any of these projects sound exciting to you, do get in touch. I want to make sure that each has a competent maintainer who has the time to commit to the project, so I will go through a short evaluation for each. Thanks in advance to everyone who volunteers to help. :-)

Read more

While I have been away this week on vacation there were 16 new submissions with new snippets! I utterly flabbergasted at how many of you good folks are contributing snippets.

I just reviewed all of these submissions and we now have a bunch of new snippets, including:

  • WebKit examples and a fantastic snippet for theming a table dynamically.
  • Handling CSV files.
  • A slew of new DesktopCouch snippets.
  • A bunch of new Clutter snippets.
  • A snippet that reads in spreadsheets (.ods files).
  • We also had some new categories started with new snippets for the inspect and gconf modules.

Thanks everyone for your rocking work! We now have 191 snippets in the library! :-)

Want to contribute? Go and find out how!

Read more

With the goal of Acire and Python Snippets seeking to serve multiple distributions, it seemed appropriate to give it it’s own website. Thanks to the wonderful people over at for making my fave CMS available as a free hosted service, we now have our new website!

This was a result of a few hours work, so there is plenty to do on the site. Let me know what kind of content you would like to see.

Of course, the most important page is the how to contribute a snippet page if you…er…get my drift. ;-)

Read more

As I have blogged about recently, I have been really getting into the idea of enabling opportunistic developers to get to grips with writing applications for the Open Source desktop as easily as possible. This has including raving about the awesome Quickly and I recently wrote Acire, a simple program for viewing a library of Python Snippets that can be used to read, learn from, run and help lower the barrier for making your own programs rock and roll.

Back at UDS there was an awesome snippets party which resulted in many examples on this wiki page, but it is just a webpage and of course you can’t see them in Acire, you can’t run them and you can’t play with them right away. I started moving some of them over to the Python Snippets library but I need your help! This is as simple as putting together some example programs, adding some information at the top in the comments and submitting them for review.

If we can get these (and other!) snippets included, it will be another awesome resource to enable our awesome developer community to make fantastic apps that make our desktop rock that little bit more.

Interested? Intrigued? Want to help make the goodness happen? Well, read on…

Creating Snippets

Before you create your snippets, I recommend you install the nice and fresh Acire 0.2.

Here is how you go about creating the snippets.

Step 1: Grab the library

Just run:

bzr branch lp:python-snippets

Step 2: Create your snippet

A snippet should demonstrate a specific feature in a given module or in the Python language. This could include showing how to use a specific widget, a feature of that widget, or another function. The list of snippets in the Quickly Snippets page is ideal for porting over to snippets!

python-snippets is divided into sub-directories which outlines the theme of the snippets. You should pick the most appropriate directory to put your snippet it, and add it there. If a suitable directory does not exist already, create it and add it there.

Step 3: Add metadata

The way Acire pulls out the snippets is by detecting some specific metadata additions to comments at the top of the file You should now add the following meta data as comments to the top of the file:

# [SNIPPET_NAME: A Short Name For The Snippet]
# [SNIPPET_CATEGORIES: Category]  <-- see CATEGORIES file for existing categories
# [SNIPPET_DESCRIPTION: A single line description of the snippet]
# [SNIPPET_AUTHOR: Your Name <>]
# [SNIPPET_LICENSE: An Open Source license (from the LICENSES file)]

Here is an example:

# [SNIPPET_NAME: Playing a Pipeline]
# [SNIPPET_DESCRIPTION: Construct and play a pipeline]
# [SNIPPET_AUTHOR: Jono Bacon <>]

You now need to add your file to your branch with:

bzr add

Step 4: Propose it for merging

With your new snippet ready, it is time to propose it for inclusion in the main python-snippets library.

First, commit your changes to your local branch with:

bzr commit

Now push it to your own branch on Launchpad:

bzr push lp:~<your launchpad username>/python-snippets/<name of your branch>

As an example:

bzr push lp:~jonobacon/python-snippets/gstreamer-snippets

Now go to and you should see your branch listed there. Click on it and when the branch page information page loads click on the Propose for merging link. Add a short description of what you examples do in the Initial Comment box and then click the Propose Merge button.

We will then review the merge and if it looks good, add it to python-snippets and it will be delivered to Acire users in the next daily package upload. :-)

I really appreciate any time you can spend in contributing snippets!

Read more