•  

The Pyed Piper: A Modern Python Alternative to awk, sed and Other Unix Text Manipulation Utilities

A session at PyCon US 2012

  • Toby Rosen

Saturday 10th March, 2012

4:55pm to 5:30pm (PST)

"The Pyed Piper", or pyp, is a linux command line text manipulation tool similar to awk or sed, but which uses standard python string and list methods as well as custom functions evolved to generate fast results in an intense production environment.

Pyp is a linux command line text manipulation tool similar to awk or sed, but which uses standard python string and list methods as well as custom functions evolved to generate fast results in an intense production environment. Pyed Pyper was developed at Sony Pictures Imageworks to facilitate the construction of complex image manipulation unix commands during visual effects work on Alice in Wonderland, Green Lantern, and the upcoming The Amazing Spiderman.

Because pyp employs its own internal piping syntax ("|") similar to unix pipes, complex operations can be proceduralized by feeding the output of one python command to the input of the next. This greatly simplifies the generation and troubleshooting of multistep operations without the use of temporary variables or nested parentheses.

pyp output has been optimized for typical production scenarios. For example, if text is broken up into an array using the "split()" method, the output will be automatically numbered by field making selecting a particular field trivial. Numerous other conveniences have been included, such as an accessible history of all inter-pipe sub-results, an ability to perform mathematical operations, and a complement of variables based on common metacharcter split/join operations.

For power users, commands can be easily saved and recalled from disk as macros, providing an alternative to quick and dirty scripting. For the truly advanced user, additional methods can be added to the pyp class via a config file, allowing tight integration with larger facilities data structures or custom toolsets.

About the speaker

This person is speaking at this event.
Toby Rosen

Coverage of this session

Sign in to add slides, notes or videos to this session

Tell your friends!

When

Time 4:55pm5:30pm PST

Date Sat 10th March 2012

Short URL

lanyrd.com/spcht

Official session page

us.pycon.org/…e/presentation/14/

View the schedule

Share

Topics

See something wrong?

Report an issue with this session