Skip to main content

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 1.0.0, the model schema, the conlang command line, and the Spec format are stable; within 1.x we make only additive, backwards-compatible changes. 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

1.0 is this feature set, stabilized and documented:

  • 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.

Planned after 1.0: adverbial subordinate clauses (because / when / if), non-finite complements, direct quotation, a numeral system, and formal semantics.

License

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

Metadata

Release files for conlanggen 1.0.0

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

Source distribution (sdist)

Source distribution for conlanggen 1.0.0
File Size Uploaded
conlanggen-1.0.0.tar.gz 204.9 kB Details

Built distribution (wheel)

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

Total release size: 291.1 kB

Release files / conlanggen-1.0.0.tar.gz

Download URL conlanggen-1.0.0.tar.gz
Size 204.9 kB
Tags Source
SHA-256 checksum
How to use checksums
579dd4273068fb3315a5065e26e329273c86920f4a25447883b96a956b0e29c4
BLAKE2b-256 checksum
How to use checksums
dc835cf5c133ae1e660ffec17fe0d6aeedb9713cf51e3ab10c1b01b39fad6db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

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

Download URL conlanggen-1.0.0-py3-none-any.whl
Size 86.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccd2cccc68369560705a4926893c485bde2404cd6bfc1fda1ab4af8a756a8fcf
BLAKE2b-256 checksum
How to use checksums
9bfb874c912ad89992d0489af1a306554b42273b35b626ecd3b6bafe41e01d0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

1.12.0

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

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