Cross platform string syntax for reliably extracting object data
Project description
Cross platform string syntax for reliably extracting object data
Usage examples
import Populater Person = { "age": 17, "name": { "first": "Marty", "last": "Mcfly", "full": "Marty Mcfly" } } ctx = Populater( Person ) assert ctx('{{ age }}') == '17' assert ctx('< age') == 17 assert ctx('= {{ age }}') == 17 assert ctx("< name.first") == "Marty" assert ctx("= {{ age }} > 18") is True assert ctx("{{ name.none }}") == "" assert ctx("= {{ name.none }}") is None assert ctx(":= {{ name.full }}") == "= Marty Mcfly" assert ctx("= '= {{ name.full }}'") == "= Marty Mcfly" assert ctx(":: {{ name.full }}") == ": Marty Mcfly" assert ctx("= self['name']['full']") == "Marty Mcfly"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
populater-0.1.5.tar.gz
(3.6 kB
view hashes)