toy language on yaml or json
Project description
toylang on yaml or json
command line example
main.yaml
code:
$import: ./filters.py
as: f
definitions:
$let:
nums: {$load: ./nums.yaml#/definitions/nums0/enum}
odds:
type: integer
enum:
$f.odds: {$get: nums}
even:
type: integer
enum:
$f.evens: {$get: nums}
nums.yaml
definitions:
nums0:
type: integer
enum:
[1, 2, 3, 4, 5, 6]
nums1:
type: integer
enum:
[1, 2, 3, 5, 7, 11]
filters.py
def odds(nums):
return [n for n in nums if n % 2 == 1]
def evens(nums):
return [n for n in nums if n % 2 == 0]
run.
$ zenmai examples/readme2/main.yaml
output
zenmai main.yaml
definitions:
odds:
type: integer
enum:
- 1
- 3
- 5
even:
type: integer
enum:
- 2
- 4
- 6
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
zenmai-0.1.0.tar.gz
(7.5 kB
view hashes)
Built Distribution
zenmai-0.1.0-py2.py3-none-any.whl
(13.0 kB
view hashes)
Close
Hashes for zenmai-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9f473cabccc4eebb7cbe6e95d0fc6251dd60fc2673a59ff704c080c7f9f52fe |
|
MD5 | e9fe7a25b0f6addc47ddc484b3875464 |
|
BLAKE2b-256 | 44edd7702b735c0f88fea0cd290cca91b5f030d91f0e416eae68816ca87ae30b |