Query international country groupings (EU, BRICS, G20, NATO, etc.)
Project description
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
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
worldcountrygroups-0.5.0.tar.gz
(50.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file worldcountrygroups-0.5.0.tar.gz.
File metadata
- Download URL: worldcountrygroups-0.5.0.tar.gz
- Upload date:
- Size: 50.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.12.67
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25429b7e7aefe0bb873097abb90856c7ac022fa1e4f81ecf0ab29265e49e43eb
|
|
| MD5 |
e0b23e09fb61fc661131b473aa495c01
|
|
| BLAKE2b-256 |
eff6945bf08216cf50834763e15e22fed5736d48a181cafcb2f82a0b19ded0da
|
File details
Details for the file worldcountrygroups-0.5.0-py3-none-any.whl.
File metadata
- Download URL: worldcountrygroups-0.5.0-py3-none-any.whl
- Upload date:
- Size: 116.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.12.67
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
763827f729ef2643a0087f94e5292c3183ebf56bfe804e2c36da455f8c156cee
|
|
| MD5 |
0717866a027c96f27409d1bc14cc6ff1
|
|
| BLAKE2b-256 |
fc631e6141cf67cffddd5e20e39f43f03d4084f73ce3859f535acfcf7e5e57da
|