Skip to main content

worldcountrygroups

Query international country groupings (EU, BRICS, G20, NATO, etc.) with 46 built-in group definitions.

Installation

pip install worldcountrygroups          # core library only
pip install worldcountrygroups[api]     # with FastAPI server

Python API

import worldcountrygroups

# List all group IDs
worldcountrygroups.list_groups()  # ['acd', 'acp', ..., 'zangger']

# Get a group with full details
group = worldcountrygroups.get_group("brics")
print(group.name)           # "BRICS"
print(group.country_count)  # 5

# Get countries in a group
countries = worldcountrygroups.get_countries("eu")
print(len(countries))       # 27

# Search groups by country, domain, or text
worldcountrygroups.search_groups(country="Brazil")    # groups containing Brazil
worldcountrygroups.search_groups(domain="Africa")     # groups in Africa domain
worldcountrygroups.search_groups(q="european")        # text search

API Server

worldcountrygroups serve --port 8000

Endpoints

Method Path Description
GET /groups List all groups (summaries)
GET /groups/{gid} Get full group with countries
GET /groups/{gid}/countries Get countries in a group
GET /countries/{iso} Get group memberships for a country
GET /search?q=&country=&domain= Search groups

License

MIT

Metadata

Release files for worldcountrygroups 0.5.0

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

Source distribution (sdist)

Source distribution for worldcountrygroups 0.5.0
File Size Uploaded Provenance
worldcountrygroups-0.5.0.tar.gz 50.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 166.1 kB

Release files / worldcountrygroups-0.5.0.tar.gz

Download URL worldcountrygroups-0.5.0.tar.gz
Size 50.0 kB
Tags Source
SHA-256 checksum
How to use checksums
25429b7e7aefe0bb873097abb90856c7ac022fa1e4f81ecf0ab29265e49e43eb
BLAKE2b-256 checksum
How to use checksums
eff6945bf08216cf50834763e15e22fed5736d48a181cafcb2f82a0b19ded0da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.12.3 Linux/6.12.67

Release files / worldcountrygroups-0.5.0-py3-none-any.whl

Download URL worldcountrygroups-0.5.0-py3-none-any.whl
Size 116.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
763827f729ef2643a0087f94e5292c3183ebf56bfe804e2c36da455f8c156cee
BLAKE2b-256 checksum
How to use checksums
fc631e6141cf67cffddd5e20e39f43f03d4084f73ce3859f535acfcf7e5e57da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.12.3 Linux/6.12.67

Security for worldcountrygroups 0.5.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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