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.
- {le-utils-0.2.7/le_utils.egg-info → le-utils-0.2.9}/PKG-INFO +2 -2
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/embed_content_request.py +7 -3
- le-utils-0.2.9/le_utils/validators/common.py +20 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/embed_content_request.py +4 -1
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/embed_topics_request.py +4 -1
- {le-utils-0.2.7 → le-utils-0.2.9/le_utils.egg-info}/PKG-INFO +2 -2
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/SOURCES.txt +1 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/setup.cfg +1 -1
- {le-utils-0.2.7 → le-utils-0.2.9}/setup.py +2 -2
- {le-utils-0.2.7 → le-utils-0.2.9}/LICENSE.txt +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/MANIFEST.in +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/README.md +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/__init__.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/__init__.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/completion_criteria.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/content_kinds.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/embed_topics_request.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/exercises.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/file_formats.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/file_types.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/format_presets.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/__init__.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/accessibility_categories.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/learning_activities.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/levels.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/needs.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/resource_type.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/labels/subjects.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/languages.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/licenses.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/mastery_criteria.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/modalities.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/roles.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/constants/uuid.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/humanhash.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/proquint.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/formatlookup.json +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/kindlookup.json +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/languagelookup.json +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/licenselookup.json +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/resources/presetlookup.json +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/uuidv5.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils/validators/__init__.py +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/dependency_links.txt +0 -0
- {le-utils-0.2.7 → le-utils-0.2.9}/le_utils.egg-info/requires.txt +0 -0
- {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.
|
|
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: >=
|
|
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
|
-
"
|
|
82
|
-
"description": "The
|
|
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(
|
|
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(
|
|
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.
|
|
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: >=
|
|
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
|
|
@@ -12,7 +12,7 @@ lang_utils_requirements = [
|
|
|
12
12
|
setup(
|
|
13
13
|
name="le-utils",
|
|
14
14
|
packages=find_packages(),
|
|
15
|
-
version="0.2.
|
|
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=">=
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|