Skip to main content

cfarewell

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

The right closing line for a formal letter.

crates.io npm PyPI Rust API

Choose a valediction from 40 locale entries, including Swiss German, British English, French, and Japanese. Explicit wording always takes precedence over table defaults. No model or network calls.

import { closing } from '@corbet-labs/cfarewell';

closing('de-ch');
// Freundliche Grüsse

Install

Environment Command
Rust / Cargo cargo add cfarewell
Python / pip python -m pip install cfarewell
Python / uv uv add cfarewell
Node.js / npm npm install @corbet-labs/cfarewell
pnpm pnpm add @corbet-labs/cfarewell
Yarn yarn add @corbet-labs/cfarewell
Bun bun add @corbet-labs/cfarewell
Deno deno add npm:@corbet-labs/cfarewell

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 { closing } = require('@corbet-labs/cfarewell');
<script type="module">
  import { closing } from 'https://cdn.jsdelivr.net/npm/@corbet-labs/cfarewell@0.2.1/dist/browser.js';
  console.log(closing('de-ch'));
</script>

Python 3.10+ packages are available on PyPI. See the installation guide for CLI commands and other distribution options. JSR publication and Typst availability are listed there explicitly.

Rust

use cfarewell::closing;

assert_eq!(closing("de-ch", None), "Freundliche Grüsse");
assert_eq!(closing("en-gb", None), "Yours sincerely,");

Python

from cfarewell import closing

assert closing("de-ch") == 'Freundliche Grüsse'

API

Function Purpose
closing(locale, override?) Resolve a valediction; even an empty override wins
availableLocales() / available_locales() List the 40 canonical locale codes

Locale matching is case-insensitive. Resolution tries the exact locale, then its base language, then English: fr-be → fr, xx → en. An override is returned unchanged, including an empty string. The locale table owns punctuation, so callers should not append another comma.

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. Version 0.2.1 retains Apache-2.0. The installation examples above refer to those available releases; 0.3.1 is published to registries.

See the licensing notes for distribution conditions and retained notices. Contributions use the Contributor License Agreement.

Release files for cfarewell 0.3.1

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

Source distribution (sdist)

Source distribution for cfarewell 0.3.1
File Size Uploaded
cfarewell-0.3.1.tar.gz 37.0 kB Details

Built distribution (wheel)

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

Total release size: 73.3 kB

Release files / cfarewell-0.3.1.tar.gz

Download URL cfarewell-0.3.1.tar.gz
Size 37.0 kB
Tags Source
SHA-256 checksum
How to use checksums
022c2daa3a44824a859d8306ca7e0e688f2ee519cee6c87cdf7547d2bfb7b2a7
BLAKE2b-256 checksum
How to use checksums
917bc176e78ee9e22c098f245a9f6f8fae8cc524c14b7735a862a1caf8e6fcc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via ccid-registry-publisher/1; https://github.com/corbet-labs/ccid

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

Download URL cfarewell-0.3.1-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4299a8879c071a1e4788028e0d74b670257f8c6c047d9faf78d5bec649e0bcb
BLAKE2b-256 checksum
How to use checksums
6498068199061e7f1ff4fcfebcb2285fa220fa1a45fc50561c1c0418143fa936
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

2 release files

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