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.3.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.3-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polyglot_hello-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6633cf3f5b914bc0226be210f8b91fff42bb99be49b434abd63b3de809a25be8
MD5 3075cd27b796e2c0d59da058d10e426a
BLAKE2b-256 f93601328a35f57bdf62f986dbdfe99cda93120357e6288af11e2db4d313db14

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyglot_hello-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: polyglot_hello-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 23.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3ea3df533a8d24be857096fdce60cbcb41b5fc4b92f3c78f22bc4c15b29a8d91
MD5 fb406595a107612e11547de319cd00f2
BLAKE2b-256 66fc1844c55a28950fcea652d2c35b30919aea5572810e5cfb4d2589028afcd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyglot_hello-0.1.3-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