Python SDK
The Python SDK is the fastest way to see SkeinRank canonicalize messy company language. It runs locally and does not require Docker, Elasticsearch, OpenRouter, the Governance API, or a custom dictionary file for the first demo.
Install
Section titled “Install”pip install skeinrankFrom a source checkout:
cd packages/skeinrank-corepoetry installTry the built-in demo dictionary
Section titled “Try the built-in demo dictionary”import skeinrank
print(skeinrank.canonicalize("k8s pg timeout"))# kubernetes postgresql timeout
print(skeinrank.extract("sev1 on kube after deploy"))# ["critical incident", "kubernetes", "deployment"]The built-in platform_ops_demo dictionary covers a compact set of platform operations, incident, CI/CD, search, RAG, and SkeinRank terms. It is designed for the first aha moment, not as a production vocabulary.
Use a small dictionary in code
Section titled “Use a small dictionary in code”from skeinrank import SkeinRank
sr = SkeinRank({ "kubernetes": ["k8s", "kube"], "postgresql": ["pg", "psql", "postgres"],})
print(sr.canonicalize("kube timeout on pg"))# kubernetes timeout on postgresql
print(sr.extract("kube timeout on pg"))# ["kubernetes", "postgresql"]Export the demo dictionary
Section titled “Export the demo dictionary”Use the CLI when you want to inspect or adapt the built-in dictionary:
skeinrank demo-dictionary --compactskeinrank demo-dictionary --output platform_ops_demo.dictionary.jsonLoad a dictionary file
Section titled “Load a dictionary file”from skeinrank import SkeinRank
sr = SkeinRank.from_file("company_dictionary.json")print(sr.canonicalize("k8s rollout uses pg database"))The dictionary-first functions remain available when you want the lower-level API:
from skeinrank import load_dictionary, extract_terms, canonicalize_text
dictionary = load_dictionary("company_dictionary.json")
result = extract_terms("k8s rollout uses pg database", dictionary=dictionary)print(result.canonical_values)
canonicalized = canonicalize_text("k8s rollout uses pg database", dictionary=dictionary)print(canonicalized.text)Extract from documents
Section titled “Extract from documents”from skeinrank import load_dictionary, extract_terms_from_document
dictionary = load_dictionary("company_dictionary.json")result = extract_terms_from_document("incident-runbook.md", dictionary=dictionary)
print(result.document.file_name)print(result.extraction.canonical_values)Public objects
Section titled “Public objects”The stable local SDK surface includes:
SkeinRank(...)SkeinRank.from_file(...)canonicalize(...)extract(...)demo_dictionary(...)demo_dictionary_payload(...)Dictionary,DictionaryTerm,DictionaryAlias,DictionaryStopListEntryload_dictionary(...)validate_dictionary(...)extract_terms(...)canonicalize_text(...)load_document_text(...)extract_terms_from_document(...)ExtractionResult,TermMatch,CanonicalizedText
Design direction
The SDK stays deterministic, local, and easy to test. The platform can govern terminology changes, but first-run canonicalization should not require a live database, model call, or search backend.