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.2.0.tar.gz
(29.7 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.2.0.tar.gz.
File metadata
- Download URL: worldcountrygroups-0.2.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
111afe7ee7d47456098e0b6bf08827f74c96b4bcbed2d53b28c25f1fccff31a9
|
|
| MD5 |
cbef79b55c668e763cc0331411de7dfd
|
|
| BLAKE2b-256 |
62a1b5c6e845c05587fd43586a33c35dbad70058821df9b6cf760b63d8f9c90d
|
File details
Details for the file worldcountrygroups-0.2.0-py3-none-any.whl.
File metadata
- Download URL: worldcountrygroups-0.2.0-py3-none-any.whl
- Upload date:
- Size: 61.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d98175bc943f4e18a936c7af540068d88c85811b9c0ab27785ab89c655dd0a
|
|
| MD5 |
cc495b7f031c3ada995a1709a4487fa9
|
|
| BLAKE2b-256 |
d86fb2703f756cf5746819c0763a8529dc93e86736bee038eb793ade22c17176
|