Python tool for sharing-preserving transformations
Sander Evers <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi YAML users, I'd like to share a small general-purpose Python function that I've written a couple of months ago. It can be used to perform custom transformations across a YAML document, such as - reversing all sequences - capitalizing all strings - changing mappings with multiple entries into sequences of one-entry mappings while preserving sharing (aliases). The first variant of the function is easier to use but does not support cyclic structures; the second variant does support them, but is a bit harder to understand. http://code.activestate.com/recipes/578117-sharing-aware-tree-transformations/ http://code.activestate.com/recipes/578118-cycle-aware-tree-transformations/ Cheers, Sander Evers ------------------------------------------------------------------------------ LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d