Skip to main content

cgreet

Superseded by cnice. New development continues as cnice.greet (same API, same vectors); this crate stays frozen at 0.3.1 and published grants are unchanged.

German salutations with the right titles and punctuation.

crates.io npm PyPI Rust API

Turn an explicitly supplied honorific, academic titles, and surname into a formal salutation for Switzerland, Liechtenstein, Germany, or Austria. Deterministic rules, no model and no network calls.

import { deSalutation } from '@corbet-labs/cgreet';

deSalutation('Frau Dr. Müller', 'ch');
// Sehr geehrte Frau Dr. Müller

Install

Environment Command
Rust / Cargo cargo add cgreet
Python / pip python -m pip install cgreet
Python / uv uv add cgreet
Node.js / npm npm install @corbet-labs/cgreet
pnpm pnpm add @corbet-labs/cgreet
Yarn yarn add @corbet-labs/cgreet
Bun bun add @corbet-labs/cgreet
Deno deno add npm:@corbet-labs/cgreet
Typst #import "@preview/cgreet:0.2.1": *

The 0.2.1 JavaScript distribution includes compiled ESM, CommonJS, TypeScript declarations, and a standalone browser module. Node.js 20+ is supported; no TypeScript loader is required.

// CommonJS
const { deSalutation } = require('@corbet-labs/cgreet');
<script type="module">
  import { deSalutation } from 'https://cdn.jsdelivr.net/npm/@corbet-labs/cgreet@0.2.1/dist/browser.js';
  console.log(deSalutation('Frau Dr. Müller', 'ch'));
</script>

Python 3.10+ packages are available on PyPI. See the installation guide for CLI commands and other distribution options. JSR installation is documented there too. The Typst interface is available on Typst Universe.

Rust

use cgreet::{de_salutation, Region};

assert_eq!(de_salutation("Frau Dr. Müller", Region::Ch), "Sehr geehrte Frau Dr. Müller");

Python

from cgreet import de_salutation

assert de_salutation("Frau Dr. Müller", "ch") == 'Sehr geehrte Frau Dr. Müller'

API

Function Purpose
deSalutation / de_salutation Complete German salutation
salutationHonorific, salutationTitles, salutationSurname Parse explicitly supplied recipient details
parseRegion / parse_region Accept ch, li, de, or at
recipientSalutationWarning, deHonorificWarning Report incomplete input

Region codes are lowercase. German and Austrian salutations end with a comma; Swiss and Liechtenstein salutations do not. A recognized Professor title takes precedence over Dr. Missing honorifics or surnames produce the generic greeting. The library does not infer a person’s gender from their name.

Correspondence family

Library Responsibility
cletter Compose the correspondence helpers
cgreet German salutations and titles
cfarewell Locale-specific closings
cdate Calendar-date formatting
cink Handwritten signature images

Development

Behavior is defined by the locale tables and shared conformance vectors. Rust, JavaScript, and Python run the same vectors. Selected CI checks exercise installed JavaScript tarballs, Python wheels and command-line entrypoints, and Typst packages. Release validation records the actual runtime and platform; Linux results do not establish native Windows or macOS coverage. All five Rust crates forbid unsafe code in their own source.

See the release guide for generation, verification, and publication commands.

License

Copyright 2026 Julian Y. Richard Corbet. The 0.3.1 release line is licensed under LGPL-3.0-only WITH LGPL-3.0-linking-exception, with the incorporated GPL version 3. Combined works may link statically or dynamically without relinking duties; library modifications stay LGPL. Applications can use a different license subject to the LGPL's conditions. Versions 0.2.0 and 0.2.1 retain MIT OR Apache-2.0. The installation examples above refer to available releases; 0.3.1 is published to registries.

See the licensing notes for distribution conditions and retained notices. Contributions are accepted under the Contributor License Agreement.

Release files for cgreet 0.3.1

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

Built distribution (wheel)

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

Release files / cgreet-0.3.1-py3-none-any.whl

Download URL cgreet-0.3.1-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d4d2aeb63e8e261818da77802be021f02c810f147abc9ba2df33b28fe46f4cf
BLAKE2b-256 checksum
How to use checksums
d8539eaebc71e28c54d82a7970701f4b0765b90673777314a6236d1e63732702
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via ccid-registry-publisher/1; https://github.com/corbet-labs/ccid

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3.0

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