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.0.tar.gz (19.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.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polyglot_hello-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for polyglot_hello-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7757e01c9550ed51ba46c8aa2086e1fc1d607d9aaf045cb9145febfc528cb23f
MD5 6bef806b39ccef29b7b4311301b16167
BLAKE2b-256 ec96ff08ced11331f367cc5d07d33e2eee511d73397f4e1d9cd56990f7b13b2f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for polyglot_hello-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f0ae38607b9dcea4106e0757e4d15e2d5865e46839bfd33c240f8d23f179700
MD5 e433968ccd7624b5b862a00d6caf6d84
BLAKE2b-256 3acb72cbfcfbb368551baa9a22042f2fe112b5eee4b4c94f52f44d01899d6e69

See more details on using hashes here.

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