Skip to content

Commit

Permalink
Merge pull request #92 from learningequality/labels
Browse files Browse the repository at this point in the history
Build the labels with their ids from a template
  • Loading branch information
rtibbles authored Oct 5, 2021
2 parents 3d28235 + da508ad commit 1738c9b
Show file tree
Hide file tree
Showing 21 changed files with 936 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish npmjs Package

on:
release:
types: [published]

jobs:
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 2.7
- run: make release-npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_API_TOKEN}}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

0.1.32 Oct 4, 2021
-------------------
- Added new labelslookup.json constants
- Added labelstemplatelookup.json and idforlabels.py
- Added build-label target for Makefile release


0.1.22 Oct 3, 2019
-------------------
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean clean-test clean-pyc clean-build test release
.PHONY: clean clean-test clean-pyc clean-build test release build-labels

clean: clean-build clean-pyc clean-test

Expand All @@ -23,6 +23,13 @@ clean-test: ## remove test and coverage artifacts
test:
pytest -s

release: clean
build-labels:
python scripts/generate_labels.py

release: clean build-labels
python setup.py sdist
twine upload dist/*.tar.gz

release-npm: clean build-labels
cd js
npm publish
18 changes: 18 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

import Needs from "./labels/Needs";
import AccessibilityCategories from "./labels/AccessibilityCategories";
import ResourceType from "./labels/ResourceType";
import Levels from "./labels/Levels";
import Subjects from "./labels/Subjects";
import LearningActivities from "./labels/LearningActivities";

export default {
Needs: Needs,
AccessibilityCategories: AccessibilityCategories,
ResourceType: ResourceType,
Levels: Levels,
Subjects: Subjects,
LearningActivities: LearningActivities,
};
11 changes: 11 additions & 0 deletions js/labels/AccessibilityCategories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
AUDIO_DESCRIPTION: "LNqKSN9j",
ALT_TEXT: "Lb0tb9VC",
CAPTIONS_SUBTITLES: "WnIhbgkY",
HIGH_CONTRAST: "uF4CI2wP",
TAGGED_PDF: "Kxx#meDW",
SIGN_LANGUAGE: "Dr4cVXkc",
};
12 changes: 12 additions & 0 deletions js/labels/LearningActivities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
READ: "wA01urpi",
CREATE: "UXADWcXZ",
PRACTICE: "VwRCom7G",
WATCH: "UD5UGM0z",
REFLECT: "3dSeJhqs",
EXPLORE: "#j8L0eq3",
LISTEN: "mkA1R3NU",
};
14 changes: 14 additions & 0 deletions js/labels/Levels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
UPPER_SECONDARY: "ZEjiwvOb",
WORK_SKILLS: "Z#97dvst",
LOWER_PRIMARY: "wnarlxKo",
LOWER_SECONDARY: "eLt0Mbu4",
UPPER_PRIMARY: "BkGYi3lD",
PRESCHOOL: "FOhG0ib",
BASIC_SKILLS: "H64ZOHfi",
PROFESSIONAL: "ZrgBU73s",
TERTIARY: "FYxwbxts",
};
15 changes: 15 additions & 0 deletions js/labels/Needs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
PRIOR_KNOWLEDGE: "sccgQZDd",
MATERIALS: "Hsw9k7Bz",
FOR_BEGINNERS: "sccgQZDd.sAQsauuo",
PAPER_PENCIL: "Hsw9k7Bz.OFIbUAK9",
OTHER_SUPPLIES: "Hsw9k7Bz.#lLv#LB7",
INTERNET: "Hsw9k7Bz.G4h2UBuK",
SPECIAL_SOFTWARE: "Hsw9k7Bz.dbXQw755",
PEOPLE: "lsoCk5Uy",
PEERS: "lsoCk5Uy.MKIzZKDO",
TEACHER: "lsoCk5Uy.H&MVs7S#",
};
15 changes: 15 additions & 0 deletions js/labels/ResourceType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
MEDIA: "rReY3LOO",
TEXTBOOK: "LQYjqpA",
LESSON_PLAN: "OqyPqhxW",
GAME: "9dUN1LWT",
BOOK: "0Et83gje",
TUTORIAL: "WtHeUU1",
ACTIVITY: "J45AL9Nb",
LESSON: "xgFjFhrA",
GUIDE: "204TGB4U",
EXERCISE: "WEEETopZ",
};
62 changes: 62 additions & 0 deletions js/labels/Subjects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
LOGIC_AND_CRITICAL_THINKING: "nX2&DRtz.YMBXStib",
CALCULUS: "d&WXdXWF.qs0Xlaxq.8rJ57ht6",
NUMERACY: "nX2&DRtz.Tsyej9ta",
READING_COMPREHENSION: "d&WXdXWF.kHKJ&PbV.r7RxB#9t",
TECHNICAL_AND_VOCATIONAL_TRAINING: "l7DsPDlm.ISEXeZt&",
LEARNING_SKILLS: "nX2&DRtz.fP2j70bj",
PROGRAMMING: "d&WXdXWF.e#RTW9E#.CfnlTDZ#",
WRITING: "d&WXdXWF.kHKJ&PbV.KFJOCr&6",
ANTHROPOLOGY: "d&WXdXWF.K80UMYnW.ViBlbQR&",
LESSON_PLANS: "ziJ6PCuU.lOBPr5ix",
SOCIAL_SCIENCES: "d&WXdXWF.K80UMYnW",
LITERATURE: "d&WXdXWF.kHKJ&PbV.DJLBbaEk",
MATHEMATICS: "d&WXdXWF.qs0Xlaxq",
DAILY_LIFE: "PbGoe2MV",
CHEMISTRY: "d&WXdXWF.i1IdaNwr.#r5ocgid",
PHYSICS: "d&WXdXWF.i1IdaNwr.r#wbt#jF",
FOR_TEACHERS: "ziJ6PCuU",
ARTS: "d&WXdXWF.5QAjgfv7",
MENTAL_HEALTH: "PbGoe2MV.d8&gCo2N",
DANCE: "d&WXdXWF.5QAjgfv7.BUMJJBnS",
WORK: "l7DsPDlm",
SCIENCES: "d&WXdXWF.i1IdaNwr",
CIVIC_EDUCATION: "d&WXdXWF.K80UMYnW.F863vKiF",
TOOLS_AND_SOFTWARE_TRAINING: "l7DsPDlm.ISEXeZt&.1JfIbP&N",
ASTRONOMY: "d&WXdXWF.i1IdaNwr.mjSF4QlF",
EARTH_SCIENCE: "d&WXdXWF.i1IdaNwr.zbDzxDE7",
COMPUTER_SCIENCE: "d&WXdXWF.e#RTW9E#",
SOCIOLOGY: "d&WXdXWF.K80UMYnW.75WBu1ZS",
CURRENT_EVENTS: "PbGoe2MV.J7CU1IxN",
BIOLOGY: "d&WXdXWF.i1IdaNwr.uErN4PdS",
POLITICAL_SCIENCE: "d&WXdXWF.K80UMYnW.K72&pITr",
DRAMA: "d&WXdXWF.5QAjgfv7.XsWznP4o",
MUSIC: "d&WXdXWF.5QAjgfv7.u0aKjT4i",
MECHANICAL_ENGINEERING: "d&WXdXWF.e#RTW9E#.8ZoaPsVW",
DIGITAL_LITERACY: "nX2&DRtz.wZ3EAedB",
WEB_DESIGN: "d&WXdXWF.e#RTW9E#.P7s8FxQ8",
LITERACY: "nX2&DRtz.HLo9TbNq",
ENTREPRENEURSHIP: "PbGoe2MV.kyxTNsRS",
GUIDES: "ziJ6PCuU.RLfhp37t",
HISTORY: "d&WXdXWF.zWtcJ&F2",
VISUAL_ART: "d&WXdXWF.5QAjgfv7.4LskOFXj",
ENVIRONMENT: "PbGoe2MV.tS7WKnZ7",
SCHOOL: "d&WXdXWF",
STATISTICS: "d&WXdXWF.qs0Xlaxq.jNm15RLB",
SKILLS_TRAINING: "l7DsPDlm.ISEXeZt&.&1WpYE&n",
ALGEBRA: "d&WXdXWF.qs0Xlaxq.0t5msbL5",
GEOMETRY: "d&WXdXWF.qs0Xlaxq.lb7ELcK5",
DIVERSITY: "PbGoe2MV.EHcbjuKq",
FINANCIAL_LITERACY: "PbGoe2MV.HGIc9sZq",
PUBLIC_HEALTH: "PbGoe2MV.kivAZaeX",
INDUSTRY_AND_SECTOR_SPECIFIC: "l7DsPDlm.ISEXeZt&.pRvOzJTE",
MEDIA_LITERACY: "PbGoe2MV.UOTL#KIV",
READING_AND_WRITING: "d&WXdXWF.kHKJ&PbV",
LANGUAGE_LEARNING: "d&WXdXWF.JDUfJNXc",
BASIC_SKILLS: "nX2&DRtz",
PROFESSIONAL_SKILLS: "l7DsPDlm.#N2VymZo",
ARITHMETIC: "d&WXdXWF.qs0Xlaxq.nG96nHDc",
};
18 changes: 18 additions & 0 deletions js/labels/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

import Needs from "./Needs";
import AccessibilityCategories from "./AccessibilityCategories";
import ResourceType from "./ResourceType";
import Levels from "./Levels";
import Subjects from "./Subjects";
import LearningActivities from "./LearningActivities";

export default {
Needs: Needs,
AccessibilityCategories: AccessibilityCategories,
ResourceType: ResourceType,
Levels: Levels,
Subjects: Subjects,
LearningActivities: LearningActivities,
};
31 changes: 31 additions & 0 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"author": "Learning Equality",
"bugs": {
"url": "https://github.com/learningequality/le-utils/issues"
},
"description": "A package that exposes constants commonly used across the Kolibri Ecosystem",
"directories": {
"src": "js"
},
"files": [
"*.js",
"**/*.js"
],
"homepage": "https://github.com/learningequality/le-utils#readme",
"keywords": [
"kolibri",
"constants",
"content"
],
"license": "MIT",
"main": "index.js",
"name": "kolibri-constants",
"repository": {
"type": "git",
"url": "git+https://github.com/learningequality/le-utils.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.32"
}
5 changes: 5 additions & 0 deletions le_utils/constants/labels/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
The constants defined in the submodules of this module are intended
only to provide additional user metadata about content, and have no impact
on their functional roles in any Kolibri tools or platforms.
"""
30 changes: 30 additions & 0 deletions le_utils/constants/labels/accessibility_categories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# AccessibilityCategories

AUDIO_DESCRIPTION = "LNqKSN9j"
ALT_TEXT = "Lb0tb9VC"
CAPTIONS_SUBTITLES = "WnIhbgkY"
HIGH_CONTRAST = "uF4CI2wP"
TAGGED_PDF = "Kxx#meDW"
SIGN_LANGUAGE = "Dr4cVXkc"

choices = (
(AUDIO_DESCRIPTION, "Audio Description"),
(ALT_TEXT, "Alt Text"),
(CAPTIONS_SUBTITLES, "Captions Subtitles"),
(HIGH_CONTRAST, "High Contrast"),
(TAGGED_PDF, "Tagged Pdf"),
(SIGN_LANGUAGE, "Sign Language"),
)

ACCESSIBILITYCATEGORIESLIST = [
AUDIO_DESCRIPTION,
ALT_TEXT,
CAPTIONS_SUBTITLES,
HIGH_CONTRAST,
TAGGED_PDF,
SIGN_LANGUAGE,
]
33 changes: 33 additions & 0 deletions le_utils/constants/labels/learning_activities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# LearningActivities

READ = "wA01urpi"
CREATE = "UXADWcXZ"
PRACTICE = "VwRCom7G"
WATCH = "UD5UGM0z"
REFLECT = "3dSeJhqs"
EXPLORE = "#j8L0eq3"
LISTEN = "mkA1R3NU"

choices = (
(READ, "Read"),
(CREATE, "Create"),
(PRACTICE, "Practice"),
(WATCH, "Watch"),
(REFLECT, "Reflect"),
(EXPLORE, "Explore"),
(LISTEN, "Listen"),
)

LEARNINGACTIVITIESLIST = [
READ,
CREATE,
PRACTICE,
WATCH,
REFLECT,
EXPLORE,
LISTEN,
]
39 changes: 39 additions & 0 deletions le_utils/constants/labels/levels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# Levels

UPPER_SECONDARY = "ZEjiwvOb"
WORK_SKILLS = "Z#97dvst"
LOWER_PRIMARY = "wnarlxKo"
LOWER_SECONDARY = "eLt0Mbu4"
UPPER_PRIMARY = "BkGYi3lD"
PRESCHOOL = "FOhG0ib"
BASIC_SKILLS = "H64ZOHfi"
PROFESSIONAL = "ZrgBU73s"
TERTIARY = "FYxwbxts"

choices = (
(UPPER_SECONDARY, "Upper Secondary"),
(WORK_SKILLS, "Work Skills"),
(LOWER_PRIMARY, "Lower Primary"),
(LOWER_SECONDARY, "Lower Secondary"),
(UPPER_PRIMARY, "Upper Primary"),
(PRESCHOOL, "Preschool"),
(BASIC_SKILLS, "Basic Skills"),
(PROFESSIONAL, "Professional"),
(TERTIARY, "Tertiary"),
)

LEVELSLIST = [
UPPER_SECONDARY,
WORK_SKILLS,
LOWER_PRIMARY,
LOWER_SECONDARY,
UPPER_PRIMARY,
PRESCHOOL,
BASIC_SKILLS,
PROFESSIONAL,
TERTIARY,
]
Loading

0 comments on commit 1738c9b

Please sign in to comment.