le-utils 0.2.7__tar.gz → 0.2.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.
Files changed (46) hide show
  1. {le-utils-0.2.7/le_utils.egg-info → le-utils-0.2.9}/PKG-INFO +2 -2
  2. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/embed_content_request.py +7 -3
  3. le-utils-0.2.9/le_utils/validators/common.py +20 -0
  4. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/embed_content_request.py +4 -1
  5. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/embed_topics_request.py +4 -1
  6. {le-utils-0.2.7 → le-utils-0.2.9/le_utils.egg-info}/PKG-INFO +2 -2
  7. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/SOURCES.txt +1 -0
  8. {le-utils-0.2.7 → le-utils-0.2.9}/setup.cfg +1 -1
  9. {le-utils-0.2.7 → le-utils-0.2.9}/setup.py +2 -2
  10. {le-utils-0.2.7 → le-utils-0.2.9}/LICENSE.txt +0 -0
  11. {le-utils-0.2.7 → le-utils-0.2.9}/MANIFEST.in +0 -0
  12. {le-utils-0.2.7 → le-utils-0.2.9}/README.md +0 -0
  13. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/__init__.py +0 -0
  14. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/__init__.py +0 -0
  15. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/completion_criteria.py +0 -0
  16. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/content_kinds.py +0 -0
  17. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/embed_topics_request.py +0 -0
  18. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/exercises.py +0 -0
  19. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/file_formats.py +0 -0
  20. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/file_types.py +0 -0
  21. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/format_presets.py +0 -0
  22. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/__init__.py +0 -0
  23. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/accessibility_categories.py +0 -0
  24. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/learning_activities.py +0 -0
  25. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/levels.py +0 -0
  26. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/needs.py +0 -0
  27. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/resource_type.py +0 -0
  28. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/subjects.py +0 -0
  29. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/languages.py +0 -0
  30. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/licenses.py +0 -0
  31. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/mastery_criteria.py +0 -0
  32. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/modalities.py +0 -0
  33. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/roles.py +0 -0
  34. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/uuid.py +0 -0
  35. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/humanhash.py +0 -0
  36. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/proquint.py +0 -0
  37. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/formatlookup.json +0 -0
  38. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/kindlookup.json +0 -0
  39. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/languagelookup.json +0 -0
  40. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/licenselookup.json +0 -0
  41. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/presetlookup.json +0 -0
  42. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/uuidv5.py +0 -0
  43. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/__init__.py +0 -0
  44. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/dependency_links.txt +0 -0
  45. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/requires.txt +0 -0
  46. {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: le-utils
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.
5
5
  Home-page: https://github.com/learningequality/le-utils
6
6
  Author: Learning Equality
@@ -13,7 +13,7 @@ Classifier: Development Status :: 2 - Pre-Alpha
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Topic :: Utilities
16
- Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <3.13
16
+ Requires-Python: >=3.6, <3.14
17
17
  Description-Content-Type: text/markdown
18
18
  Provides-Extra: lang_utils
19
19
  License-File: LICENSE.txt
@@ -78,8 +78,8 @@ SCHEMA = {
78
78
  "additionalProperties": False,
79
79
  "properties": {
80
80
  "id": {
81
- "type": "string",
82
- "description": "The ID of the content resource",
81
+ "$ref": "/schemas/common_embed_definitions#/definitions/uuid",
82
+ "description": "The UUID of the content resource",
83
83
  },
84
84
  "title": {
85
85
  "type": "string",
@@ -99,8 +99,12 @@ SCHEMA = {
99
99
  "description": "A list of files associated with the content resource",
100
100
  "items": {"$ref": "#/definitions/file"},
101
101
  },
102
+ "content_id": {
103
+ "$ref": "/schemas/common_embed_definitions#/definitions/uuid",
104
+ "description": "The UUID of the content resource(s)",
105
+ },
102
106
  },
103
- "required": ["id", "title", "description", "text"],
107
+ "required": ["id", "title", "description", "text", "content_id"],
104
108
  },
105
109
  },
106
110
  "properties": {
@@ -0,0 +1,20 @@
1
+ import json
2
+ import os
3
+
4
+ from jsonschema import RefResolver
5
+
6
+
7
+ def get_embed_schema_resolver(schema):
8
+ """
9
+ Returns a properly configured JSON schema resolver for embed schemas.
10
+
11
+ :param schema: The schema to use as the base schema
12
+ :return: A configured RefResolver
13
+ """
14
+ schema_dir = os.path.join(os.path.dirname(__file__), "..", "..", "spec")
15
+ with open(os.path.join(schema_dir, "definitions-embed_common.json")) as f:
16
+ common_definitions = json.load(f)
17
+
18
+ schema_store = {"/schemas/common_embed_definitions": common_definitions}
19
+
20
+ return RefResolver.from_schema(schema, store=schema_store)
@@ -1,6 +1,7 @@
1
1
  import jsonschema
2
2
 
3
3
  from le_utils.constants.embed_content_request import SCHEMA
4
+ from le_utils.validators.common import get_embed_schema_resolver
4
5
 
5
6
 
6
7
  def validate(data):
@@ -8,4 +9,6 @@ def validate(data):
8
9
  :param data: Dictionary of data to validate
9
10
  :raises: jsonschema.ValidationError: When invalid
10
11
  """
11
- jsonschema.validate(instance=data, schema=SCHEMA)
12
+ jsonschema.validate(
13
+ instance=data, schema=SCHEMA, resolver=get_embed_schema_resolver(SCHEMA)
14
+ )
@@ -1,6 +1,7 @@
1
1
  import jsonschema
2
2
 
3
3
  from le_utils.constants.embed_topics_request import SCHEMA
4
+ from le_utils.validators.common import get_embed_schema_resolver
4
5
 
5
6
 
6
7
  def validate(data):
@@ -8,4 +9,6 @@ def validate(data):
8
9
  :param data: Dictionary of data to validate
9
10
  :raises: jsonschema.ValidationError: When invalid
10
11
  """
11
- jsonschema.validate(instance=data, schema=SCHEMA)
12
+ jsonschema.validate(
13
+ instance=data, schema=SCHEMA, resolver=get_embed_schema_resolver(SCHEMA)
14
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: le-utils
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.
5
5
  Home-page: https://github.com/learningequality/le-utils
6
6
  Author: Learning Equality
@@ -13,7 +13,7 @@ Classifier: Development Status :: 2 - Pre-Alpha
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Topic :: Utilities
16
- Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <3.13
16
+ Requires-Python: >=3.6, <3.14
17
17
  Description-Content-Type: text/markdown
18
18
  Provides-Extra: lang_utils
19
19
  License-File: LICENSE.txt
@@ -40,5 +40,6 @@ le_utils/resources/languagelookup.json
40
40
  le_utils/resources/licenselookup.json
41
41
  le_utils/resources/presetlookup.json
42
42
  le_utils/validators/__init__.py
43
+ le_utils/validators/common.py
43
44
  le_utils/validators/embed_content_request.py
44
45
  le_utils/validators/embed_topics_request.py
@@ -1,5 +1,5 @@
1
1
  [metadata]
2
- description-file = README.md
2
+ long_description = file: README.md
3
3
 
4
4
  [flake8]
5
5
  max-line-length = 160
@@ -12,7 +12,7 @@ lang_utils_requirements = [
12
12
  setup(
13
13
  name="le-utils",
14
14
  packages=find_packages(),
15
- version="0.2.7",
15
+ version="0.2.9",
16
16
  description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
17
17
  long_description=long_description,
18
18
  long_description_content_type="text/markdown",
@@ -33,5 +33,5 @@ setup(
33
33
  ],
34
34
  author="Learning Equality",
35
35
  author_email="info@learningequality.org",
36
- python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <3.13",
36
+ python_requires=">=3.6, <3.14",
37
37
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes