Announcing the pyramid_assetmutator package

If you're like me, one of the first things you do when starting a new web application project is set up a CSS alternative such as LESS or SASS/SCSS. Those who aren't particularly fond of JavaScript might also tend to add CoffeeScript. These "metalanguages" can assist in making client-side/asset code more pleasurable to work with, as they typically provide functionality that's "missing" in the the languages they get interpreted into.

Some frameworks (e.g. Ruby on Rails) give you support for these alternatives out-of-the-box, but in the land of less opinionated software things can require a bit more work. Since I am personally a fan of the Pyramid web framework, I've used the pyramid_webassets and pyramid_fanstatic packages in the past to provide this support. However, these packages are so powerful and comprehensive that they can also tend to be somewhat involved in regards to configuration, so I recently decided to roll my own Pyramid add-on: pyramid_assetmutator

Although definitely not as "feature-full" as the packages I have mentioned earlier, as of this writing it provides the following:

  • Support for piping (a.k.a "mutating") assets through pretty much any command you like (its core functionality is quite rudimentary).
  • The ability to specify whether to have your assets "mutated" during each request, or on each "application boot" (typically best for prod setups).
  • Partial support for template language parsing in your asset files (e.g. Mako or Jinja2 template tags in your JavaScript or CSS files).
  • A unified Python 2/3 codebase.

Feel free to check it out on GitHub or browse the documentation, and share here or open a GitHub issue if you have any comments or suggestions.

more...

An rsync-like utility for Amazon S3 and Google Storage

Every so often I find myself working on that odd job that requires syncing files with Amazon's S3. In the beginning, I tried some of the various S3 FUSE interfaces—hoping for something that would play nice with rsync—but FUSE's stability always left something to be desired and more often than not I'd be left with that one transfer that never would quite finish correctly.

Eventually I discovered boto and settled in to using a hacked together (but stable) Python/boto solution for these type of tasks—all the while wondering why nobody took the time to write a "real" rsync-like client for S3.

Well, this last time around I finally decided to stop whining and take matters into my own hands. After a couple of late nights fleshing out my original boto solution, I'm happy to announce what I'm calling "boto rsync"—an rsync like wrapper for boto's cloud storage interfaces (both S3 and Google Storage).

Please take a look at the project on github and let me know what you think: http://github.com/seedifferently/boto_rsync

more...