Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for populater, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size populater-0.1.5.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page