bare-script 5.1.7__tar.gz → 5.1.9__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.7/src/bare_script.egg-info → bare_script-5.1.9}/PKG-INFO +14 -14
- {bare_script-5.1.7 → bare_script-5.1.9}/README.md +13 -13
- {bare_script-5.1.7 → bare_script-5.1.9}/pyproject.toml +1 -1
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/bare.py +2 -12
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/include.py +1 -9
- bare_script-5.1.9/src/bare_script/include_source.py +1830 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/library.py +23 -68
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/options.py +8 -13
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/runtime.py +145 -119
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/value.py +42 -62
- {bare_script-5.1.7 → bare_script-5.1.9/src/bare_script.egg-info}/PKG-INFO +14 -14
- bare_script-5.1.7/src/bare_script/include_source.py +0 -4745
- {bare_script-5.1.7 → bare_script-5.1.9}/LICENSE +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/setup.cfg +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/setup.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/__init__.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/__main__.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script/runtime_c.c +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.9}/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.9
|
|
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
|
|
@@ -322,21 +322,21 @@ without a native Python equivalent are omitted.
|
|
|
322
322
|
|
|
323
323
|
| Test | Language | Time (ms) | Multiple |
|
|
324
324
|
| ---------------- | ---------------- | --------: | -------: |
|
|
325
|
-
| mandelbrot | Python |
|
|
326
|
-
| | BareScript (PyC) |
|
|
327
|
-
| | BareScript (Py) |
|
|
328
|
-
| schemaValidate | Python | 20.7 | |
|
|
329
|
-
| | BareScript (PyC) | 105.6 | 5.1x |
|
|
330
|
-
| | BareScript (Py) | 1433.2 | 69.2x |
|
|
331
|
-
| urlEncode | Python | 1.1 | |
|
|
332
|
-
| | BareScript (PyC) | 5.7 | 5.4x |
|
|
333
|
-
| | BareScript (Py) | 39.6 | 37.5x |
|
|
325
|
+
| mandelbrot | Python | 4588.0 | |
|
|
326
|
+
| | BareScript (PyC) | 11100.0 | 2.4x |
|
|
327
|
+
| | BareScript (Py) | 340300.0 | 74.2x |
|
|
334
328
|
| schemaParse | Python | 17.2 | |
|
|
335
|
-
| | BareScript (PyC) |
|
|
336
|
-
| | BareScript (Py) |
|
|
329
|
+
| | BareScript (PyC) | 110.0 | 6.4x |
|
|
330
|
+
| | BareScript (Py) | 878.4 | 51.1x |
|
|
331
|
+
| schemaValidate | Python | 20.4 | |
|
|
332
|
+
| | BareScript (PyC) | 103.6 | 5.1x |
|
|
333
|
+
| | BareScript (Py) | 1421.2 | 69.6x |
|
|
337
334
|
| urlDecode | Python | 1.2 | |
|
|
338
|
-
| | BareScript (PyC) |
|
|
339
|
-
| | BareScript (Py) |
|
|
335
|
+
| | BareScript (PyC) | 11.1 | 9.3x |
|
|
336
|
+
| | BareScript (Py) | 66.0 | 55.5x |
|
|
337
|
+
| urlEncode | Python | 1.1 | |
|
|
338
|
+
| | BareScript (PyC) | 5.2 | 4.9x |
|
|
339
|
+
| | BareScript (Py) | 37.4 | 35.5x |
|
|
340
340
|
|
|
341
341
|
|
|
342
342
|
## Using BareScript with an AI Assistant
|
|
@@ -296,21 +296,21 @@ without a native Python equivalent are omitted.
|
|
|
296
296
|
|
|
297
297
|
| Test | Language | Time (ms) | Multiple |
|
|
298
298
|
| ---------------- | ---------------- | --------: | -------: |
|
|
299
|
-
| mandelbrot | Python |
|
|
300
|
-
| | BareScript (PyC) |
|
|
301
|
-
| | BareScript (Py) |
|
|
302
|
-
| schemaValidate | Python | 20.7 | |
|
|
303
|
-
| | BareScript (PyC) | 105.6 | 5.1x |
|
|
304
|
-
| | BareScript (Py) | 1433.2 | 69.2x |
|
|
305
|
-
| urlEncode | Python | 1.1 | |
|
|
306
|
-
| | BareScript (PyC) | 5.7 | 5.4x |
|
|
307
|
-
| | BareScript (Py) | 39.6 | 37.5x |
|
|
299
|
+
| mandelbrot | Python | 4588.0 | |
|
|
300
|
+
| | BareScript (PyC) | 11100.0 | 2.4x |
|
|
301
|
+
| | BareScript (Py) | 340300.0 | 74.2x |
|
|
308
302
|
| schemaParse | Python | 17.2 | |
|
|
309
|
-
| | BareScript (PyC) |
|
|
310
|
-
| | BareScript (Py) |
|
|
303
|
+
| | BareScript (PyC) | 110.0 | 6.4x |
|
|
304
|
+
| | BareScript (Py) | 878.4 | 51.1x |
|
|
305
|
+
| schemaValidate | Python | 20.4 | |
|
|
306
|
+
| | BareScript (PyC) | 103.6 | 5.1x |
|
|
307
|
+
| | BareScript (Py) | 1421.2 | 69.6x |
|
|
311
308
|
| urlDecode | Python | 1.2 | |
|
|
312
|
-
| | BareScript (PyC) |
|
|
313
|
-
| | BareScript (Py) |
|
|
309
|
+
| | BareScript (PyC) | 11.1 | 9.3x |
|
|
310
|
+
| | BareScript (Py) | 66.0 | 55.5x |
|
|
311
|
+
| urlEncode | Python | 1.1 | |
|
|
312
|
+
| | BareScript (PyC) | 5.2 | 4.9x |
|
|
313
|
+
| | BareScript (Py) | 37.4 | 35.5x |
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
## Using BareScript with an AI Assistant
|
|
@@ -7,20 +7,13 @@ bare-script command-line interface (CLI)
|
|
|
7
7
|
|
|
8
8
|
import argparse
|
|
9
9
|
from functools import partial
|
|
10
|
-
import os
|
|
11
10
|
import sys
|
|
12
11
|
import time
|
|
13
12
|
|
|
13
|
+
from . import evaluate_expression, execute_script
|
|
14
14
|
from .options import fetch_read_write, log_stdout, url_file_relative
|
|
15
15
|
from .runtime import SYSTEM_GLOBAL_INCLUDES_NAME, barescript_lint_script, barescript_parse_expression, barescript_parse_script
|
|
16
16
|
from .value import value_boolean
|
|
17
|
-
if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
|
|
18
|
-
try:
|
|
19
|
-
from .runtime_c import evaluate_expression, execute_script
|
|
20
|
-
except ImportError:
|
|
21
|
-
from .runtime import evaluate_expression, execute_script
|
|
22
|
-
else:
|
|
23
|
-
from .runtime import evaluate_expression, execute_script
|
|
24
17
|
|
|
25
18
|
|
|
26
19
|
def main(argv=None):
|
|
@@ -33,6 +26,7 @@ def main(argv=None):
|
|
|
33
26
|
if sys.version_info >= (3, 14): # pragma: no cover
|
|
34
27
|
argument_parser_args['color'] = False
|
|
35
28
|
parser = argparse.ArgumentParser(**argument_parser_args)
|
|
29
|
+
parser.set_defaults(scripts=[])
|
|
36
30
|
parser.add_argument('file', nargs='*', action=_FileScriptAction, help='files to process')
|
|
37
31
|
parser.add_argument('-c', '--code', action=_InlineScriptAction, help='execute the BareScript code')
|
|
38
32
|
parser.add_argument('-d', '--debug', action='store_true', help='enable debug mode')
|
|
@@ -159,13 +153,9 @@ def main(argv=None):
|
|
|
159
153
|
|
|
160
154
|
class _InlineScriptAction(argparse.Action):
|
|
161
155
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
162
|
-
if 'scripts' not in namespace:
|
|
163
|
-
setattr(namespace, 'scripts', [])
|
|
164
156
|
namespace.scripts.append(('code', values))
|
|
165
157
|
|
|
166
158
|
|
|
167
159
|
class _FileScriptAction(argparse.Action):
|
|
168
160
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
169
|
-
if 'scripts' not in namespace:
|
|
170
|
-
setattr(namespace, 'scripts', [])
|
|
171
161
|
namespace.scripts.extend(('file', value) for value in values)
|
|
@@ -5,15 +5,7 @@
|
|
|
5
5
|
Include library script globals and native stub functions
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
|
|
11
|
-
try:
|
|
12
|
-
from .runtime_c import execute_script
|
|
13
|
-
except ImportError:
|
|
14
|
-
from .runtime import execute_script
|
|
15
|
-
else:
|
|
16
|
-
from .runtime import execute_script
|
|
8
|
+
from . import execute_script
|
|
17
9
|
|
|
18
10
|
|
|
19
11
|
# The include library script globals - execute the include library script
|