Skip to main content

Hello and Hello World in 200+ languages, with simple APIs by name, code, or index.

Project description

polyglot-hello

This was written with Cursor and ChatGPT-5.

Simple Python library and CLI for “Hello” and “Hello World” in 200+ languages.

  • APIs: get by language name, code (ISO 639-1 and common alternates), or numeric index
  • CLI: polyglot-hello hello [id] and polyglot-hello world [id]
  • Data: 200+ curated entries with hello and hello_world

Install

pip install polyglot-hello

Usage (Python)

from polyglot_hello import say_hello, say_hello_world, get_by_code, get_by_name, list_languages

print(say_hello())               # random
print(say_hello_world())         # random
print(say_hello_world("en"))    # by code
print(say_hello_world("Spanish"))

g = get_by_code("fr")
print(g.name, g.hello, g.hello_world)

langs = list_languages()
print(len(langs))

CLI

polyglot-hello hello           # random “Hello”
polyglot-hello world           # random “Hello World”
polyglot-hello hello en        # by code
polyglot-hello world Spanish   # by name
polyglot-hello list            # list with indexes
polyglot-hello search hola     # fuzzy search

Examples

See examples/hello_world.py for a minimal integration. Run with:

python examples/hello_world.py

API

  • say_hello(identifier: str|int|None = None) -> str: returns “Hello” for the resolved language
  • say_hello_world(identifier: str|int|None = None) -> str: returns “Hello World”
  • get_by_name(name: str) -> Greeting
  • get_by_code(code: str) -> Greeting
  • get_by_index(index: int) -> Greeting
  • list_languages() -> list[str]
  • search(query: str) -> list[Greeting]

The Greeting object has: index, name, code, codes, hello, hello_world.

Language codes

Primary codes are ISO 639-1 when available (e.g., en, es, fr), plus helpful alternates in codes (e.g., ISO 639-2 eng, regional tags like pt-BR). You can pass any recognized code or the full language name.

Contributing

PRs to add or improve languages welcome. Please ensure entries include:

{
  "name": "Language Name",
  "code": "primary-code",
  "codes": ["alt1", "alt2"],
  "hello": "...",
  "hello_world": "..."
}

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyglot_hello-0.1.2.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polyglot_hello-0.1.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file polyglot_hello-0.1.2.tar.gz.

File metadata

  • Download URL: polyglot_hello-0.1.2.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for polyglot_hello-0.1.2.tar.gz
Algorithm Hash digest
SHA256 35fc2d5bc0c8a18930c89bc6661de3e2006ae67d1a73047e4e45bf917bf0bf8d
MD5 888f4f64ef6ac8bffd722c11d2d5ce65
BLAKE2b-256 5933f40829450ebf59aed6aecbdcfa26f03411c366438b93315e31304556a2e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyglot_hello-0.1.2.tar.gz:

Publisher: release.yml on chrismatteson/polyglot-hello

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyglot_hello-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: polyglot_hello-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for polyglot_hello-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c99064e91c4077d68c88b17e1ee8bc971cfdd3767b787f58e108cd241bc91465
MD5 fc2761b06edc064ffaa6a15c34c4c013
BLAKE2b-256 4951617f7725094fcc81af3e9b282cf6a1fcf2c23fe1326bc04d8686529e84d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyglot_hello-0.1.2-py3-none-any.whl:

Publisher: release.yml on chrismatteson/polyglot-hello

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page