Skip to main content

cgreet

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.0 release line is licensed under LGPL-3.0-only [WITH LGPL-3.0-linking-exception](https://github.com/corbet-labs/cgreet/blob/main/LICENSES/LGPL-3.0-only WITH LGPL-3.0-linking-exception.txt), 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; version 0.1.0 and earlier retain their FSL-1.1-ALv2 grants. The installation examples above refer to available releases; 0.3.0 has not yet been published to registries.

See the licensing notes for distribution conditions and retained notices.

Release files for cgreet 0.3.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 cgreet 0.3.0
File Size Uploaded
cgreet-0.3.0.tar.gz 38.1 kB Details

Built distribution (wheel)

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

Total release size: 76.9 kB

Release files / cgreet-0.3.0.tar.gz

Download URL cgreet-0.3.0.tar.gz
Size 38.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e10d9154c6abce3efa85174a01201b4a16f4e7818064cce8bf5587976cde0f8
BLAKE2b-256 checksum
How to use checksums
0a9a3083ed41bada7696a200e979066364e1f6fbb4275bfb23cf644618086755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL cgreet-0.3.0-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
039f2fa46dcf70dcd7a3a4a47b1ddac6ca7a199a3e8d259fb445581d0803c900
BLAKE2b-256 checksum
How to use checksums
d92183aaf50eba875224d1037e6dab19851dde82f8aca8c5d6cd28ab236c35e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.3.0 This release

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