Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

conlang

A partial-spec constructed-language generator.

You describe only what you care about — phonology, syllable shapes, a handful of words — and the generator samples the rest from typologically-plausible defaults. Same spec plus same seed always produces byte-identical output, and sampled entries can be locked so they survive re-sampling.

spec (YAML) ──▶ generate ──▶ model (canonical JSON) ──▶ render ──▶ dictionary + grammar sketch
                                   │
                                   ├── lint   (machine-checkable invariants)
                                   └── bench  (plausibility scorecard vs. Kah)

The model JSON is the single source of truth; the dictionary, grammar sketch, and every other view are rendered from it.

Install

pip install conlanggen

The distribution is conlanggen, but the import package and the command are both conlang — import conlang, conlang generate.

Quickstart

# Generate from the example spec and render a Markdown dictionary.
conlang generate --spec spec\example.yaml --render

# Happy with it? Freeze it into an explicit spec so the values stick.
conlang accept --model out\veshtari.json

Output lands in out/: a model JSON and a rendered .md. Then:

conlang lint   --model out\veshtari.json
conlang render --model out\veshtari.json --out out\veshtari.md

Documentation

Guarantees and lint rules

Reproducibility is the one hard guarantee: spec + seed ⇒ identical bytes. Everything else is reported by lint as errors or warnings, and a broken language is still generated (conlangers want to explore broken states).

rule severity meaning
schema error/warning schema version present and known (a recognised older version warns; an unknown one errors)
lexeme.root error lexeme has a non-empty root
phonotactics.lexeme error every root is a legal word
phonotactics.word error every inflected form is a legal word
lexicon.homophones warning two roots collide (Kah has polysemy too)
morphology.paradigm warning a word is missing a form for a category its class realises
morphology.class error a word names an inflection class the language does not define
lexicon.nonempty warning the lexicon is empty
orthography.unknown warning the spelling map names a symbol that is not in the inventory
orthography.collision warning two symbols would spell the same thing
script.coverage warning the script does not cover every segment/syllable it must

Every rule above has a test in tests/test_lint.py, tests/test_lint_invariants.py, or tests/test_morphology.py.

Stability

Starting with 2.0.0, the model schema, the conlang command line, and the Spec format are stable; within 2.x we make only additive, backwards-compatible changes. 1.x files upgrade with conlang migrate. See STABILITY.md for the promise and how deprecation works.

Development

.\.venv\Scripts\python.exe -m pytest
.\.venv\Scripts\python.exe -m ruff check .
.\.venv\Scripts\python.exe -m mypy src

The package layout:

src/conlang/
  model/        canonical pydantic schema (the source of truth)
  sampling/     deterministic RNG, inventory presets, concepts, defaults
  phonology/    tokenization, syllabification, legality checks
  lexicon/      seeded root generation, stable per-item seeding
  morphology/   affixes, inflection classes, and word-form assembly
  soundchange/  ordered sound changes; derive a daughter language
  syntax/       word order, alignment, clause linearisation, place structure
  script/       writing systems (glyphs)
  render/       Markdown dictionary + grammar sketch
  lint/         machine-checkable invariants
  bench/        Kah adapter + scorecard
  cli.py        thin command-line view over the library

Roadmap

Shipped so far (1.0 froze the core; 1.1–1.16 add tiers):

  • Phonology — inventory, phonotactics, seeded word generation.
  • IPA inventories — declare the inventory phonemic (ipa: true) and derive a romanised orthography alongside the phonemic forms.
  • Morphology — affix breadth, inflection classes, and stacking.
  • Diachrony — conlang evolve: ordered sound changes (with environments) derive a daughter language, recorded in lineage.
  • Syntax — sampled word order and alignment, case marking with subject agreement, the predication tier, clause sequencing, and aspect.
  • Translation pipeline — conlang new / grow / translate / validate-translation / extras, including a grammar-match port from a sibling.
  • Writing systems — conlang script: a sampled script (alphabet / syllabary / impure abjad / featural) rendered as deterministic SVG glyphs.
  • Data packs — optional, pinned PHOIBLE and WALS ground sampling (conlang data fetch), with a graceful fallback to the built-in presets.
  • Feature-driven phonology — natural classes and feature-based sound-change rules.
  • Place structure — an ordered list of semantic roles per predicate; role-labelled clauses.
  • Semantics — negation, quantifiers, coordination, and topic/focus markers.
  • Complex clauses — relative, complement, and reported clauses.
  • Adverbial clauses — causal (because), temporal (when), and conditional (if) adjuncts, positioned by head direction.
  • Numerals — a closed digit class that composes cardinals in base 10 (ordered by word order) and derives ordinals with an ORD affix.
  • Infinitives & quotation — non-finite complements with subject control (an inf marker before a bare verb) and a quot particle for direct, verbatim quotation.
  • Initial mutation — a Mutation table on the model plus triggers, so a language can lenite/eclipse a word's initial segment by grammatical context (Celtic); a ## Mutation view and a mutation.table lint rule.
  • Meaning — a compositional meaning layer: a typed lambda denotation per lexeme (derived from its place structure) and composed truth conditions (predication, negation, generalized quantifiers), rendered in a ## Meaning view.
  • Model & entailment — a spec-declared semantic model (a domain of individuals plus predicate extensions) that evaluates clauses to truth values and checks entailment by model-checking the declared model; a ## Model view.
  • Lexicon converter — conlang convert-lexicon: a Muna-style lexicon TSV → a spec lexicon (the conlang ↔ muna cross-pollination seam).
  • Optional alignment — syntax.alignment: none marks no case (for a no-case language).
  • Modifier order — syntax.modifier_order (prenominal/postnominal) decouples the noun phrase's modifier side from word order (so a language can be SOV and postnominal).
  • Pronouns — a closed pron class (the personal set 1SG–3PL plus who/what).
  • Paradigms view — conlang render emits a ## Paradigms section (agreement, class prefixes, pronouns, numerals) as Markdown tables.
  • Function inventory — a dem class, 25 adposition senses, until, any, and who/what/ where/how question words.
  • Subordinator edge — syntax.subordinator_edge (initial/final) lets an OV language lead its subordinators.
  • Oblique relative — a relative clause whose gap is an adpositional phrase (the adposition stranded).
  • Degree constructions — a deg class + DegreePhrase (comparative much … and …, equative same … and …).
  • Aspect particles — a closed asp class (PROG/PRF), placed around the verb.

Planned after 1.0: validity over all models, and meaning for relatives/complements/tense.

License

MIT (code). Kah dictionary and grammar content remains Kwesho's and is not part of this repository.

Metadata

Release files for conlanggen 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for conlanggen 2.0.0
File Size Uploaded Provenance
conlanggen-2.0.0.tar.gz 417.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for conlanggen 2.0.0
File Interpreter ABI Platform
conlanggen-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 531.8 kB

Release files / conlanggen-2.0.0.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL conlanggen-2.0.0.tar.gz
Size 417.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e314f65c81ef5546382cd9ed96dc2c34cd7870a38556d51ba9255c9c577b2de
BLAKE2b-256 checksum
How to use checksums
2b00465f6f26d4bb726546fb14377d181465d1c4a0ecd057b279a6985aaf5f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / conlanggen-2.0.0-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL conlanggen-2.0.0-py3-none-any.whl
Size 114.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddcccc0a7ddbfc2e246b40337d5aec28780e400d31706028eacf66631183f93b
BLAKE2b-256 checksum
How to use checksums
4000924ed8c01433d4ba6b366051211aec146e882b3905604a38cde1696ab95c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for conlanggen 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 1.2.0 2 files With provenance
  • Added 2.0.0 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page