bare-script 5.1.12__tar.gz → 5.1.14__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.
- {bare_script-5.1.12/src/bare_script.egg-info → bare_script-5.1.14}/PKG-INFO +13 -1
- {bare_script-5.1.12 → bare_script-5.1.14}/README.md +12 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/pyproject.toml +1 -1
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/include.py +103 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/include_source.py +711 -456
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/library.py +23 -6
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/options.py +15 -8
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/runtime.py +5 -3
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/runtime_c.c +17 -1
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/value.py +64 -6
- {bare_script-5.1.12 → bare_script-5.1.14/src/bare_script.egg-info}/PKG-INFO +13 -1
- {bare_script-5.1.12 → bare_script-5.1.14}/LICENSE +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/setup.cfg +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/setup.py +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/__init__.py +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/__main__.py +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script/bare.py +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-5.1.12 → bare_script-5.1.14}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bare-script
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.14
|
|
4
4
|
Summary: BareScript; a lightweight scripting and expression language
|
|
5
5
|
Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -49,6 +49,7 @@ confident that BareScript will execute the same regardless of the underlying run
|
|
|
49
49
|
|
|
50
50
|
- [The BareScript Language](https://craigahobbs.github.io/bare-script-py/language/)
|
|
51
51
|
- [The BareScript Library](https://craigahobbs.github.io/bare-script-py/library/)
|
|
52
|
+
- [BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/)
|
|
52
53
|
- [API Documentation](https://craigahobbs.github.io/bare-script-py/)
|
|
53
54
|
- [Source code](https://github.com/craigahobbs/bare-script-py)
|
|
54
55
|
|
|
@@ -285,6 +286,17 @@ To run a MarkdownUp script (`.bare`) from this package, use `bare -m` (Markdown
|
|
|
285
286
|
[MarkdownUp web app](https://craigahobbs.github.io/markdown-up/).
|
|
286
287
|
|
|
287
288
|
|
|
289
|
+
## BareScript Creator
|
|
290
|
+
|
|
291
|
+
[BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/) generates a ready-to-build
|
|
292
|
+
BareScript project from a specification you write. Choose a project type (a MarkdownUp frontend
|
|
293
|
+
application, to start), fill in its form, and download the project as a `.tar.gz` archive with a
|
|
294
|
+
Makefile, a unit test suite, and the bare-script skill. In the project directory, `make run` has
|
|
295
|
+
[Claude Code](https://claude.com/product/claude-code#featureTerminal), in your terminal, write the
|
|
296
|
+
code and its tests from your specification, then serves the application in your browser. The
|
|
297
|
+
creator keeps a history of your projects so you can refine a specification and create it again.
|
|
298
|
+
|
|
299
|
+
|
|
288
300
|
## C Runtime
|
|
289
301
|
|
|
290
302
|
The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
|
|
@@ -23,6 +23,7 @@ confident that BareScript will execute the same regardless of the underlying run
|
|
|
23
23
|
|
|
24
24
|
- [The BareScript Language](https://craigahobbs.github.io/bare-script-py/language/)
|
|
25
25
|
- [The BareScript Library](https://craigahobbs.github.io/bare-script-py/library/)
|
|
26
|
+
- [BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/)
|
|
26
27
|
- [API Documentation](https://craigahobbs.github.io/bare-script-py/)
|
|
27
28
|
- [Source code](https://github.com/craigahobbs/bare-script-py)
|
|
28
29
|
|
|
@@ -259,6 +260,17 @@ To run a MarkdownUp script (`.bare`) from this package, use `bare -m` (Markdown
|
|
|
259
260
|
[MarkdownUp web app](https://craigahobbs.github.io/markdown-up/).
|
|
260
261
|
|
|
261
262
|
|
|
263
|
+
## BareScript Creator
|
|
264
|
+
|
|
265
|
+
[BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/) generates a ready-to-build
|
|
266
|
+
BareScript project from a specification you write. Choose a project type (a MarkdownUp frontend
|
|
267
|
+
application, to start), fill in its form, and download the project as a `.tar.gz` archive with a
|
|
268
|
+
Makefile, a unit test suite, and the bare-script skill. In the project directory, `make run` has
|
|
269
|
+
[Claude Code](https://claude.com/product/claude-code#featureTerminal), in your terminal, write the
|
|
270
|
+
code and its tests from your specification, then serves the application in your browser. The
|
|
271
|
+
creator keeps a history of your projects so you can refine a specification and create it again.
|
|
272
|
+
|
|
273
|
+
|
|
262
274
|
## C Runtime
|
|
263
275
|
|
|
264
276
|
The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
|
|
@@ -15,10 +15,12 @@ execute_script(
|
|
|
15
15
|
'statements': [
|
|
16
16
|
{'include': {'includes': [
|
|
17
17
|
{'url': 'barescriptModel.bare', 'system': True},
|
|
18
|
+
{'url': 'base64.bare', 'system': True},
|
|
18
19
|
{'url': 'data.bare', 'system': True},
|
|
19
20
|
{'url': 'dataLineChart.bare', 'system': True},
|
|
20
21
|
{'url': 'dataTable.bare', 'system': True},
|
|
21
22
|
{'url': 'elementModel.bare', 'system': True},
|
|
23
|
+
{'url': 'gzip.bare', 'system': True},
|
|
22
24
|
{'url': 'markdown.bare', 'system': True},
|
|
23
25
|
{'url': 'markdownElements.bare', 'system': True},
|
|
24
26
|
{'url': 'markdownParser.bare', 'system': True},
|
|
@@ -28,6 +30,7 @@ execute_script(
|
|
|
28
30
|
{'url': 'schemaDoc.bare', 'system': True},
|
|
29
31
|
{'url': 'schemaParser.bare', 'system': True},
|
|
30
32
|
{'url': 'schemaTypeModel.bare', 'system': True},
|
|
33
|
+
{'url': 'tar.bare', 'system': True},
|
|
31
34
|
{'url': 'url.bare', 'system': True}
|
|
32
35
|
]}}
|
|
33
36
|
]
|
|
@@ -113,6 +116,36 @@ def barescript_validate_script(script):
|
|
|
113
116
|
return result['result']
|
|
114
117
|
|
|
115
118
|
|
|
119
|
+
#
|
|
120
|
+
# base64.bare
|
|
121
|
+
#
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def base64_decode(text):
|
|
125
|
+
"""
|
|
126
|
+
Decode a base64 string to a byte value array
|
|
127
|
+
|
|
128
|
+
:param str text: The base64-encoded string
|
|
129
|
+
:return: The byte value array, or None if decoding fails
|
|
130
|
+
:rtype: list(int) or None
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return _INCLUDE_GLOBALS['base64Decode']([text], _include_options())
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def base64_encode(bytes_):
|
|
137
|
+
"""
|
|
138
|
+
Encode a byte value array (or a string, as UTF-8) as a base64 string
|
|
139
|
+
|
|
140
|
+
:param bytes_: The byte value array (integers 0 to 255) or string
|
|
141
|
+
:type bytes_: list(int) or str
|
|
142
|
+
:return: The base64-encoded string, or None if encoding fails
|
|
143
|
+
:rtype: str or None
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
return _INCLUDE_GLOBALS['base64Encode']([bytes_], _include_options())
|
|
147
|
+
|
|
148
|
+
|
|
116
149
|
#
|
|
117
150
|
# data.bare
|
|
118
151
|
#
|
|
@@ -382,6 +415,39 @@ def element_model_validate(elements):
|
|
|
382
415
|
return result['result']
|
|
383
416
|
|
|
384
417
|
|
|
418
|
+
#
|
|
419
|
+
# gzip.bare
|
|
420
|
+
#
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
def gzip_compress(bytes_, level=None):
|
|
424
|
+
"""
|
|
425
|
+
Compress a byte value array (or a string, as UTF-8) with gzip
|
|
426
|
+
|
|
427
|
+
:param bytes_: The byte value array (integers 0 to 255) or string
|
|
428
|
+
:type bytes_: list(int) or str
|
|
429
|
+
:param level: The compression level, 0 (store) through 9 (best); default is 6
|
|
430
|
+
:type level: int or None
|
|
431
|
+
:return: The gzip-compressed byte value array, or None if compression fails
|
|
432
|
+
:rtype: list(int) or None
|
|
433
|
+
"""
|
|
434
|
+
|
|
435
|
+
return _INCLUDE_GLOBALS['gzipCompress']([bytes_, level], _include_options())
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
def gzip_uncompress(bytes_):
|
|
439
|
+
"""
|
|
440
|
+
Uncompress a gzip-compressed byte value array
|
|
441
|
+
|
|
442
|
+
:param bytes_: The gzip-compressed byte value array (integers 0 to 255)
|
|
443
|
+
:type bytes_: list(int)
|
|
444
|
+
:return: The uncompressed byte value array, or None if uncompression fails
|
|
445
|
+
:rtype: list(int) or None
|
|
446
|
+
"""
|
|
447
|
+
|
|
448
|
+
return _INCLUDE_GLOBALS['gzipUncompress']([bytes_], _include_options())
|
|
449
|
+
|
|
450
|
+
|
|
385
451
|
#
|
|
386
452
|
# markdown.bare
|
|
387
453
|
#
|
|
@@ -704,6 +770,43 @@ def schema_type_model_validate(types):
|
|
|
704
770
|
return result['result']
|
|
705
771
|
|
|
706
772
|
|
|
773
|
+
#
|
|
774
|
+
# tar.bare
|
|
775
|
+
#
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
def tar_create(files):
|
|
779
|
+
"""
|
|
780
|
+
Create a tar archive (USTAR format) from an array of regular files. Each file has mode 644, and no directory
|
|
781
|
+
entries are written.
|
|
782
|
+
|
|
783
|
+
:param files: The array of file objects. Each file object has the following members:
|
|
784
|
+
|
|
785
|
+
- "name" - the file path
|
|
786
|
+
- "bytes" - the file content byte value array (integers 0 to 255) or string (as UTF-8)
|
|
787
|
+
- "mtime" - the optional file modification datetime (default is the Unix epoch)
|
|
788
|
+
:type files: list(dict)
|
|
789
|
+
:return: The tar archive byte value array, or None if creation fails
|
|
790
|
+
:rtype: list(int) or None
|
|
791
|
+
"""
|
|
792
|
+
|
|
793
|
+
return _INCLUDE_GLOBALS['tarCreate']([files], _include_options())
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
def tar_extract(bytes_):
|
|
797
|
+
"""
|
|
798
|
+
Extract the regular files of a tar archive (USTAR, GNU, or PAX format)
|
|
799
|
+
|
|
800
|
+
:param bytes_: The tar archive byte value array (integers 0 to 255)
|
|
801
|
+
:type bytes_: list(int)
|
|
802
|
+
:return: The array of file objects, each with "name", "bytes", and "mtime" (the modification datetime) members,
|
|
803
|
+
or None if extraction fails
|
|
804
|
+
:rtype: list(dict) or None
|
|
805
|
+
"""
|
|
806
|
+
|
|
807
|
+
return _INCLUDE_GLOBALS['tarExtract']([bytes_], _include_options())
|
|
808
|
+
|
|
809
|
+
|
|
707
810
|
#
|
|
708
811
|
# url.bare
|
|
709
812
|
#
|