yamlscript 0.1.63__tar.gz → 0.1.66__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yamlscript-0.1.63/lib/yamlscript.egg-info → yamlscript-0.1.66}/PKG-INFO +1 -1
- {yamlscript-0.1.63 → yamlscript-0.1.66}/ReadMe.md +49 -21
- {yamlscript-0.1.63 → yamlscript-0.1.66}/lib/yamlscript/__init__.py +2 -2
- {yamlscript-0.1.63 → yamlscript-0.1.66/lib/yamlscript.egg-info}/PKG-INFO +1 -1
- {yamlscript-0.1.63 → yamlscript-0.1.66}/setup.py +1 -1
- {yamlscript-0.1.63 → yamlscript-0.1.66}/.long_description.md +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/MANIFEST.in +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/lib/yamlscript.egg-info/SOURCES.txt +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/lib/yamlscript.egg-info/dependency_links.txt +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/lib/yamlscript.egg-info/requires.txt +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/lib/yamlscript.egg-info/top_level.txt +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/setup.cfg +0 -0
- {yamlscript-0.1.63 → yamlscript-0.1.66}/test/test.py +0 -0
|
@@ -1,37 +1,54 @@
|
|
|
1
|
+
<!-- DO NOT EDIT — THIS FILE WAS GENERATED -->
|
|
2
|
+
|
|
1
3
|
YAMLScript
|
|
2
4
|
==========
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
Add Logic to Your YAML Files
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
## Synopsis
|
|
8
10
|
|
|
11
|
+
Load `file.yaml` with YAMLScript:
|
|
9
12
|
```yaml
|
|
10
|
-
|
|
13
|
+
!yamlscript/v0/
|
|
14
|
+
|
|
15
|
+
=>:
|
|
16
|
+
names =: curl(
|
|
17
|
+
"https://raw.githubusercontent.com/dominictarr/" +
|
|
18
|
+
"random-name/master/first-names.json")
|
|
19
|
+
.json/load()
|
|
20
|
+
|
|
21
|
+
name:: names.rand-nth()
|
|
22
|
+
aka:: names.rand-nth()
|
|
23
|
+
age:: 6 * 7
|
|
24
|
+
color: yellow
|
|
25
|
+
```
|
|
11
26
|
|
|
12
|
-
|
|
13
|
-
|
|
27
|
+
and get:
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"name": "Anthea",
|
|
31
|
+
"aka": "Patrizia",
|
|
32
|
+
"age": 42,
|
|
33
|
+
"color": "yellow"
|
|
34
|
+
}
|
|
14
35
|
```
|
|
15
36
|
|
|
16
37
|
|
|
17
38
|
## Description
|
|
18
39
|
|
|
19
|
-
YAMLScript is a functional programming language with a
|
|
40
|
+
[YAMLScript](https://yamlscript.org) is a functional programming language with a
|
|
41
|
+
clean YAML syntax.
|
|
20
42
|
|
|
21
|
-
YAMLScript can be used for
|
|
43
|
+
YAMLScript can be used for enhancing ordinary [YAML](https://yaml.org) files
|
|
44
|
+
with functional operations, such as:
|
|
22
45
|
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Enhancing ordinary YAML files with new functional magics
|
|
27
|
-
* Import parts of other YAML files to any node
|
|
28
|
-
* String interpolation including function calls
|
|
29
|
-
* Any other functionality you can dream up!
|
|
30
|
-
* Writing reusable shared libraries
|
|
31
|
-
* High level code instead of C
|
|
32
|
-
* Bindable to almost any programming language
|
|
46
|
+
* Import parts of other YAML files to any node
|
|
47
|
+
* String interpolation including function calls
|
|
48
|
+
* Data transforms including ones defined by you
|
|
33
49
|
|
|
34
|
-
YAMLScript should be a drop-in replacement for your YAML
|
|
50
|
+
This YAMLScript library should be a drop-in replacement for your current YAML
|
|
51
|
+
loader!
|
|
35
52
|
|
|
36
53
|
Most existing YAML files are already valid YAMLScript files.
|
|
37
54
|
This means that YAMLScript works as a normal YAML loader, but can also evaluate
|
|
@@ -47,10 +64,18 @@ YAMLScript is compiled to a native shared library (`libyamlscript.so`) that can
|
|
|
47
64
|
be used by any programming language that can load shared libraries.
|
|
48
65
|
|
|
49
66
|
To see the Clojure code that YAMLScript compiles to, you can use the YAMLScript
|
|
50
|
-
|
|
67
|
+
CLI binary, `ys`, to run:
|
|
51
68
|
|
|
52
69
|
```text
|
|
53
70
|
$ ys --compile file.ys
|
|
71
|
+
(def names
|
|
72
|
+
(_-> (curl (+_ "https://raw.githubusercontent.com/dominictarr/"
|
|
73
|
+
"random-name/master/first-names.json"))
|
|
74
|
+
(list json/load)))
|
|
75
|
+
{"age" (*_ 6 7),
|
|
76
|
+
"aka" (_-> names (list rand-nth)),
|
|
77
|
+
"color" "yellow",
|
|
78
|
+
"name" (_-> names (list rand-nth))}
|
|
54
79
|
```
|
|
55
80
|
|
|
56
81
|
|
|
@@ -118,15 +143,18 @@ See https://github.com/yaml/yamlscript?#installing-yamlscript for more info.
|
|
|
118
143
|
|
|
119
144
|
## See Also
|
|
120
145
|
|
|
121
|
-
* [
|
|
122
|
-
* [
|
|
123
|
-
* [
|
|
146
|
+
* [YAMLScript Web Site](https://yamlscript.org)
|
|
147
|
+
* [YAMLScript Blog](https://yamlscript.org/blog)
|
|
148
|
+
* [YAMLScript Source Code](https://github.com/yaml/yamlscript)
|
|
149
|
+
* [YAMLScript Samples](https://github.com/yaml/yamlscript/tree/main/sample)
|
|
150
|
+
* [YAMLScript Programs](https://rosettacode.org/wiki/Category:YAMLScript)
|
|
124
151
|
* [YAML](https://yaml.org)
|
|
125
152
|
* [Clojure](https://clojure.org)
|
|
126
153
|
|
|
127
154
|
|
|
128
155
|
## Authors
|
|
129
156
|
|
|
157
|
+
|
|
130
158
|
* [Ingy döt Net](https://github.com/ingydotnet)
|
|
131
159
|
|
|
132
160
|
|
|
@@ -16,7 +16,7 @@ object that the YAMLScript code evaluates to.
|
|
|
16
16
|
# This value is automatically updated by 'make bump'.
|
|
17
17
|
# The version number is used to find the correct shared library file.
|
|
18
18
|
# We currently only support binding to an exact version of libyamlscript.
|
|
19
|
-
yamlscript_version = '0.1.
|
|
19
|
+
yamlscript_version = '0.1.66'
|
|
20
20
|
|
|
21
21
|
import os, sys
|
|
22
22
|
import ctypes
|
|
@@ -40,7 +40,7 @@ def find_libyamlscript_path():
|
|
|
40
40
|
"Unsupported platform '%s' for yamlscript." % sys.platform)
|
|
41
41
|
|
|
42
42
|
# We currently bind to an exact version of libyamlscript.
|
|
43
|
-
# eg 'libyamlscript.so.0.1.
|
|
43
|
+
# eg 'libyamlscript.so.0.1.66'
|
|
44
44
|
libyamlscript_name = \
|
|
45
45
|
"libyamlscript.%s.%s" % (so, yamlscript_version)
|
|
46
46
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|