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"
Release files for populater 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| populater-0.1.5.tar.gz | 3.6 kB | Details |
Release files / populater-0.1.5.tar.gz
| Download URL | populater-0.1.5.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53f776d31c9bd6c04b3722a0e4b7063bf2b034acae94de72147109dd398e8a50
|
|
BLAKE2b-256 checksum How to use checksums |
32f48dd101df2410bff4fcd4893f298a87a56c6eff068f5ca32a497da3a7c1fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |