standardgraph 1.2.0__tar.gz → 1.2.2__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: standardgraph
3
- Version: 1.2.0
4
- Summary: 157,000+ education standards (math, science, ELA, social studies, CS, arts) across 298 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
3
+ Version: 1.2.2
4
+ Summary: 158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
5
5
  Author: StandardGraph
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/swoopeagle/standardgraph
@@ -22,9 +22,9 @@ Requires-Dist: numpy>=1.26.0
22
22
 
23
23
  # standardgraph
24
24
 
25
- **20,000+ math standards across 75+ curriculum systems, accessible as a Claude MCP server.**
25
+ **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
26
26
 
27
- Covers the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, and more all cross-referenced to CCSS via NLP semantic similarity.
27
+ Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
28
28
 
29
29
  ## Install (macOS)
30
30
 
@@ -1,8 +1,8 @@
1
1
  # standardgraph
2
2
 
3
- **20,000+ math standards across 75+ curriculum systems, accessible as a Claude MCP server.**
3
+ **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
4
4
 
5
- Covers the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, and more all cross-referenced to CCSS via NLP semantic similarity.
5
+ Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
6
6
 
7
7
  ## Install (macOS)
8
8
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "standardgraph"
3
- version = "1.2.0"
4
- description = "157,000+ education standards (math, science, ELA, social studies, CS, arts) across 298 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server"
3
+ version = "1.2.2"
4
+ description = "158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  license = "MIT"
@@ -149,6 +149,19 @@ _AP_META = {"country": "United States", "country_code": "US", "region": "N
149
149
  _US_STATE_SUFFIXES = {"-sci", "-ela", "-ss", "-cs"}
150
150
 
151
151
 
152
+ # Quality scores come from two sources: LLM rubric scoring ("[LLM score N/5]") and
153
+ # deterministic exact-match scoring ("[exact-match N/5]", assigned when source and
154
+ # target standard text are byte-identical). Both are surfaced as quality_score.
155
+ _SCORE_RE = re.compile(r"\[(?:LLM score|exact-match) (\d)/5\]")
156
+
157
+
158
+ def _parse_quality(notes: str | None) -> int | None:
159
+ if not notes:
160
+ return None
161
+ m = _SCORE_RE.search(notes)
162
+ return int(m.group(1)) if m else None
163
+
164
+
152
165
  def _meta(system: str) -> dict:
153
166
  if system in SYSTEM_META:
154
167
  return SYSTEM_META[system]
@@ -607,6 +620,7 @@ def map_standard(
607
620
  from_system: str,
608
621
  to_system: str,
609
622
  confidence_threshold: float = 0.7,
623
+ include_flagged: bool = False,
610
624
  ) -> str:
611
625
  """Find the closest equivalent to a standard in a different curriculum system.
612
626
 
@@ -624,8 +638,11 @@ def map_standard(
624
638
  from_system: system code of the source standard (e.g. 'tx', 'ca-on', 'sg-moe').
625
639
  to_system: target system code (any indexed system).
626
640
  confidence_threshold: minimum cosine similarity for primary results (default 0.7).
641
+ include_flagged: if True, include mappings flagged for review (LLM quality score 1-2).
642
+ Default False returns only verified-quality mappings.
627
643
 
628
- Returns matched standards with confidence score, grade alignment, and mapping method.
644
+ Returns matched standards with confidence score, grade alignment, quality_score (1-5),
645
+ flagged status, and mapping method.
629
646
  """
630
647
  sid = _expand_id(standard_id, from_system)
631
648
  conn = _db()
@@ -638,40 +655,53 @@ def map_standard(
638
655
  src_dict = dict(src)
639
656
 
640
657
  # ── 1. Precomputed crosswalk above threshold ───────────────────────────────
658
+ flagged_clause = "" if include_flagged else "AND cm.flagged_for_review = 0"
641
659
  mappings = conn.execute(
642
- """SELECT cm.*, s.standard_text AS target_text, s.grade AS target_grade,
660
+ f"""SELECT cm.*, s.standard_text AS target_text, s.grade AS target_grade,
643
661
  s.domain AS target_domain
644
662
  FROM crosswalk_mappings cm
645
663
  JOIN standards s ON s.id = cm.target_id
646
664
  WHERE cm.source_id = ?
647
665
  AND cm.target_system = ?
648
666
  AND cm.confidence_score >= ?
667
+ {flagged_clause}
649
668
  ORDER BY cm.confidence_score DESC""",
650
669
  (sid, to_system, confidence_threshold),
651
670
  ).fetchall()
652
671
 
653
672
  if mappings:
654
673
  conn.close()
674
+ result_list = [
675
+ {
676
+ "target_id": m["target_id"],
677
+ "target_standard_text": m["target_text"],
678
+ "relationship": m["relationship"],
679
+ "confidence": m["confidence_score"],
680
+ "quality_score": _parse_quality(m["notes"]),
681
+ "flagged": bool(m["flagged_for_review"]),
682
+ "grade_delta": m["grade_delta"],
683
+ "grade_alignment": "exact" if m["grade_delta"] == 0 else (
684
+ f"{abs(m['grade_delta'])} year{'s' if abs(m['grade_delta']) > 1 else ''} "
685
+ f"{'later' if m['grade_delta'] > 0 else 'earlier'} in target"
686
+ ),
687
+ "verified_by_human": bool(m["verified_by_human"]),
688
+ "notes": m["notes"],
689
+ }
690
+ for m in mappings
691
+ ]
692
+ # Rank by quality then confidence. Unscored rows (quality_score is None) are
693
+ # of *unknown* quality, not zero quality — treat them as a neutral midpoint so
694
+ # a high-cosine unscored match isn't buried beneath a mediocre scored one.
695
+ # (Score-1/2 rows are already filtered out by default via flagged_clause.)
696
+ result_list.sort(
697
+ key=lambda x: (x["quality_score"] if x["quality_score"] is not None else 3, x["confidence"]),
698
+ reverse=True,
699
+ )
655
700
  return json.dumps({
656
701
  "source_id": src_dict["id"],
657
702
  "target_curriculum": to_system,
658
703
  "mapping_method": "precomputed_crosswalk",
659
- "mappings": [
660
- {
661
- "target_id": m["target_id"],
662
- "target_standard_text": m["target_text"],
663
- "relationship": m["relationship"],
664
- "confidence": m["confidence_score"],
665
- "grade_delta": m["grade_delta"],
666
- "grade_alignment": "exact" if m["grade_delta"] == 0 else (
667
- f"{abs(m['grade_delta'])} year{'s' if abs(m['grade_delta']) > 1 else ''} "
668
- f"{'later' if m['grade_delta'] > 0 else 'earlier'} in target"
669
- ),
670
- "verified_by_human": bool(m["verified_by_human"]),
671
- "notes": m["notes"],
672
- }
673
- for m in mappings
674
- ],
704
+ "mappings": result_list,
675
705
  }, indent=2)
676
706
 
677
707
  # ── 2. Best precomputed result below threshold ─────────────────────────────
@@ -793,6 +823,8 @@ def map_standard(
793
823
  "target_id": best_below["target_id"],
794
824
  "target_standard_text": best_below["target_text"],
795
825
  "confidence": round(best_below["confidence_score"], 4),
826
+ "quality_score": _parse_quality(best_below["notes"]),
827
+ "flagged": bool(best_below["flagged_for_review"]),
796
828
  "below_threshold": True,
797
829
  "threshold_used": confidence_threshold,
798
830
  }
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: standardgraph
3
- Version: 1.2.0
4
- Summary: 157,000+ education standards (math, science, ELA, social studies, CS, arts) across 298 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
3
+ Version: 1.2.2
4
+ Summary: 158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
5
5
  Author: StandardGraph
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/swoopeagle/standardgraph
@@ -22,9 +22,9 @@ Requires-Dist: numpy>=1.26.0
22
22
 
23
23
  # standardgraph
24
24
 
25
- **20,000+ math standards across 75+ curriculum systems, accessible as a Claude MCP server.**
25
+ **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
26
26
 
27
- Covers the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, and more all cross-referenced to CCSS via NLP semantic similarity.
27
+ Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
28
28
 
29
29
  ## Install (macOS)
30
30
 
File without changes