Query international country groupings (EU, BRICS, G20, NATO, etc.)
Project description
countrygroups
Query international country groupings (EU, BRICS, G20, NATO, etc.) with 46 built-in group definitions.
Installation
pip install countrygroups # core library only
pip install countrygroups[api] # with FastAPI server
Python API
import countrygroups
# List all group IDs
countrygroups.list_groups() # ['acd', 'acp', ..., 'zangger']
# Get a group with full details
group = countrygroups.get_group("brics")
print(group.name) # "BRICS"
print(group.country_count) # 5
# Get countries in a group
countries = countrygroups.get_countries("eu")
print(len(countries)) # 27
# Search groups by country, domain, or text
countrygroups.search_groups(country="Brazil") # groups containing Brazil
countrygroups.search_groups(domain="Africa") # groups in Africa domain
countrygroups.search_groups(q="european") # text search
API Server
countrygroups 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.1.0.tar.gz
(29.6 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.1.0.tar.gz.
File metadata
- Download URL: worldcountrygroups-0.1.0.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e97d4dc6c0aed012f9e5192c3126a360da4a815f7a93c9b80b085a671866b88
|
|
| MD5 |
2ac4a4dfca437e0cb6bf25c2555534c1
|
|
| BLAKE2b-256 |
ee316ad0ef17b42fa744adc2789bc0c0279a520128ca80a5501b4f39acbeaf25
|
File details
Details for the file worldcountrygroups-0.1.0-py3-none-any.whl.
File metadata
- Download URL: worldcountrygroups-0.1.0-py3-none-any.whl
- Upload date:
- Size: 60.5 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 |
ca2dec59c652f290ff7bf5789e9884cb928b74255892245561fc630029397fbc
|
|
| MD5 |
710152ccc2c2517c7561b88f375ffd55
|
|
| BLAKE2b-256 |
9772e5b456043ec255d2d89cbf40bf3566e31ae9899a6366f0ad2d98516a00a5
|