bare-script 5.0.3__tar.gz → 5.0.4__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.
Files changed (25) hide show
  1. {bare_script-5.0.3/src/bare_script.egg-info → bare_script-5.0.4}/PKG-INFO +1 -1
  2. {bare_script-5.0.3 → bare_script-5.0.4}/setup.cfg +1 -1
  3. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/include.py +14 -5
  4. {bare_script-5.0.3 → bare_script-5.0.4/src/bare_script.egg-info}/PKG-INFO +1 -1
  5. {bare_script-5.0.3 → bare_script-5.0.4}/LICENSE +0 -0
  6. {bare_script-5.0.3 → bare_script-5.0.4}/README.md +0 -0
  7. {bare_script-5.0.3 → bare_script-5.0.4}/pyproject.toml +0 -0
  8. {bare_script-5.0.3 → bare_script-5.0.4}/setup.py +0 -0
  9. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/__init__.py +0 -0
  10. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/__main__.py +0 -0
  11. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/bare.py +0 -0
  12. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/include_source.py +0 -0
  13. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/library.py +0 -0
  14. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/lint.py +0 -0
  15. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/model.py +0 -0
  16. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/options.py +0 -0
  17. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/parser.py +0 -0
  18. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/runtime.py +0 -0
  19. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/runtime_c.c +0 -0
  20. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script/value.py +0 -0
  21. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script.egg-info/SOURCES.txt +0 -0
  22. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script.egg-info/dependency_links.txt +0 -0
  23. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script.egg-info/entry_points.txt +0 -0
  24. {bare_script-5.0.3 → bare_script-5.0.4}/src/bare_script.egg-info/requires.txt +0 -0
  25. {bare_script-5.0.3 → bare_script-5.0.4}/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.0.3
3
+ Version: 5.0.4
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bare-script
3
- version = 5.0.3
3
+ version = 5.0.4
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -150,7 +150,8 @@ def data_parse_csv(text):
150
150
  """
151
151
  Parse CSV text to a data array
152
152
 
153
- :param str text: The CSV text
153
+ :param text: The CSV text or array of CSV text
154
+ :type text: str or list(str)
154
155
  :return: The data array
155
156
  :rtype: list(dict)
156
157
  """
@@ -533,7 +534,7 @@ def schema_get_struct_members(types, struct):
533
534
  return _INCLUDE_GLOBALS['schemaGetStructMembers']([types, struct], _include_options())
534
535
 
535
536
 
536
- def schema_validate(types, type_name, value):
537
+ def schema_validate(types, type_name, value, member_fqn=None):
537
538
  """
538
539
  Validate a value using a schema type model
539
540
 
@@ -541,11 +542,13 @@ def schema_validate(types, type_name, value):
541
542
  :type types: dict
542
543
  :param str type_name: The type name
543
544
  :param value: The value to validate
545
+ :param member_fqn: The fully-qualified member name (for error messages)
546
+ :type member_fqn: str or None, optional
544
547
  :return: The validated, transformed value
545
548
  :raises SchemaValidationError: A validation error occurred
546
549
  """
547
550
 
548
- result = _INCLUDE_GLOBALS['schemaValidateEx']([types, type_name, value], _include_options())
551
+ result = _INCLUDE_GLOBALS['schemaValidateEx']([types, type_name, value, member_fqn], _include_options())
549
552
  if 'error' in result:
550
553
  raise SchemaValidationError(result['error'], result['memberFqn'])
551
554
  return result['result']
@@ -577,18 +580,24 @@ def schema_doc_markdown(types, type_name, options=None):
577
580
  #
578
581
 
579
582
 
580
- def schema_parse(text):
583
+ def schema_parse(text, types=None, filename=None, validate=None):
581
584
  """
582
585
  Parse Schema Markdown text
583
586
 
584
587
  :param text: The `Schema Markdown <https://craigahobbs.github.io/schema-markdown-js/language/>`__ text
585
588
  :type text: str or list(str)
589
+ :param types: The schema's `type model <https://craigahobbs.github.io/bare-script/model/#var.vName='Types'>`__ to update
590
+ :type types: dict or None, optional
591
+ :param filename: The file name (for error messages)
592
+ :type filename: str or None, optional
593
+ :param validate: If True (the default), validate the type model after parsing
594
+ :type validate: bool or None, optional
586
595
  :return: The schema's `type model <https://craigahobbs.github.io/bare-script/model/#var.vName='Types'>`__
587
596
  :rtype: dict
588
597
  :raises SchemaParserError: A parsing error occurred
589
598
  """
590
599
 
591
- result = _INCLUDE_GLOBALS['schemaParseEx']([text], _include_options())
600
+ result = _INCLUDE_GLOBALS['schemaParseEx']([text, types, filename, validate], _include_options())
592
601
  if 'errors' in result:
593
602
  raise SchemaParserError(result['errors'])
594
603
  return result['result']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 5.0.3
3
+ Version: 5.0.4
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
File without changes
File without changes
File without changes
File without changes