Skip to main content

worldref (Python)

242 countries and territories in Arabic and English: names, aliases, phone plans, currencies, geo, locale, addresses, subdivisions, plus search, sorting, phone parsing and address forms. Standard library only, Python 3.9 or newer.

Install

pip install worldref

Usage

from worldref import countries, by_iso2, search, sort_countries, parse_phone, address_form, subdivisions

sa = by_iso2("sa")
print(sa.name_ar, sa.name_en, sa.flag)                  # السعودية Saudi Arabia 🇸🇦
print([c.iso2 for c in search(countries(), "سعودية", "ar")][:3])
print(search(countries(), "Kuwiat")[0].iso2)            # KW (small typos are forgiven when nothing matches)
print([c.name_en for c in sort_countries(countries(), "en", first="SA")][:3])
p = parse_phone("0501234567", sa, countries())
print(p.e164, p.valid, p.mobile)                        # +966501234567 True True
for line in address_form(sa, "ar"):                     # the address fields line by line
    print([(f.field, f.label, f.required) for f in line])
print(len(subdivisions("SA")))

Metadata

Release files for worldref 1.2.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 worldref 1.2.1
File Size Uploaded Provenance Actions
worldref-1.2.1.tar.gz 201.2 kB With provenance Details for worldref-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 408.3 kB

Release files / worldref-1.2.1.tar.gz

Download URL worldref-1.2.1.tar.gz
Size 201.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ba75de93108592ead94aa4bfa13ab1d3d2728ea2707367d73e02af243648bfd
BLAKE2b-256 checksum
How to use checksums
6e00bda03e2806e217d52d88d9b05a591b54d572ccc4a6e56a3ef0f3570c10d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / worldref-1.2.1-py3-none-any.whl

Download URL worldref-1.2.1-py3-none-any.whl
Size 207.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c57a6f3ab2781aa0a02a4e1d7ad3a7047de251141baddd1fb97592829e49542
BLAKE2b-256 checksum
How to use checksums
f4793052fb24f23bd3ad8022c65bcad6d502faec96fb1c2f5da02f2e8feeb992
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for worldref 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for worldref-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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